Java Date Time - Clock tickMinutes(ZoneId zone) example








Clock tickMinutes(ZoneId zone) returns a clock for the current instant ticking in whole minutes.

Syntax

tickMinutes has the following syntax.

public static Clock tickMinutes(ZoneId zone)

Example

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.