Clock tickMinutes(ZoneId zone)
returns a clock
for the current instant ticking in whole minutes.
tickMinutes
has the following syntax.
public static Clock tickMinutes(ZoneId zone)
The following example shows how to use tickMinutes
.
import java.time.Clock; import java.time.ZoneId; /* www . jav a 2 s . c om*/ public class Main { public static void main(String[] args) { Clock clock = Clock.tickMinutes(ZoneId.systemDefault()); System.out.println(clock); System.out.println(clock.instant()); } }
The code above generates the following result.