Obtains the current year-month from the system clock in the specified time-zone.
Obtains the current year-month from the specified clock.
package com.logicbig.example.yearmonth;
import java.time.Clock;
import java.time.Duration;
import java.time.YearMonth;
public class NowExample3 {
public static void main(String... args) {
Clock c = Clock.tick(Clock.systemDefaultZone(), Duration.ofHours(20000));
System.out.println(c);
YearMonth y = YearMonth.now(c);
System.out.println(y);
}
}
Output
TickClock[SystemClock[America/Chicago],PT20000H]
2015-08