Obtains a clock that returns the current instant ticking in whole minutes using best available system clock. The current instant is converted to the instant of the specified time-zone.
package com.logicbig.example.clock;
import java.time.Clock;
import java.time.ZoneId;
public class TickMinutesExample {
public static void main(String... args) {
Clock c = Clock.tickMinutes(ZoneId.of("Chile/EasterIsland"));
System.out.println(c);
}
}
Output
TickClock[SystemClock[Chile/EasterIsland],PT1M]