Example usage for java.time Clock tickMinutes

List of usage examples for java.time Clock tickMinutes

Introduction

In this page you can find the example usage for java.time Clock tickMinutes.

Prototype

public static Clock tickMinutes(ZoneId zone) 

Source Link

Document

Obtains a clock that returns the current instant ticking in whole minutes using the best available system clock.

Usage

From source file:Main.java

public static void main(String[] args) {
    Clock clock = Clock.tickMinutes(ZoneId.systemDefault());
    System.out.println(clock);//from w w  w.  j ava  2 s .  co m
    System.out.println(clock.instant());
}

From source file:Main.java

public static void main(String[] args) {
    Clock clock = Clock.tickMinutes(ZoneId.systemDefault());
    Duration duration = Duration.ofHours(3);
    Clock newClock = Clock.tick(clock, duration);

    System.out.println(newClock.instant());
}