What is Instant in Java?

In Java, the Instant class is part of the java.time package, which was introduced in Java 8. It represents a specific moment on the timeline in UTC (Coordinated Universal Time) with nanosecond precision. The Instant class is immutable and can be used to model a point in time anywhere in the world.

Unlike date-time classes that are tied to a timezone (like ZonedDateTime), an Instant is always expressed in terms of UTC and does not carry any timezone information. This makes it ideal for capturing timestamps.


Java Instant Java time API timestamp UTC Java 8