Java Date Time Java Java API
java.time.Clock
public abstract Instant instant()
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); }}
SystemClock[America/Chicago]2025-10-29T12:13:36.841Z