Returns the current instant of this clock.
package com.logicbig.example.clock;
import java.time.Clock;
import java.time.Instant;
public class InstantExample {
public static void main(String... args) {
Clock c = Clock.systemDefaultZone();
System.out.println(c);
Instant instant = c.instant();
System.out.println(instant);
}
}
Output
SystemClock[America/Chicago]
2017-05-01T20:48:12.861Z