Example usage for java.time Clock tickSeconds

List of usage examples for java.time Clock tickSeconds

Introduction

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

Prototype

public static Clock tickSeconds(ZoneId zone) 

Source Link

Document

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

Usage

From source file:Main.java

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