The Java class to represent an instantaneous point on the time-line. This might be used to record event time-stamps in the application. Use this tag for questions about the java.time.Instant class or its ThreeTen Backport equoivalent, org.threeten.bp.Instant. If your question involves more classes from the java.time API, rather consider the java-time tag and/or the jsr310 tag.
The Instant
class is part of the modern Java date and time API known as java.time
or JSR-310. It replaces the old classes java.util.Date
and java.sql.Timestamp
.
As part of the modern API Instant
is built-in with Java 8 and later, and is available in Java 6 and 7 through the ThreeTen Backport, the backport of JSR-310 to Java 6 and 7.
The Instant
class is immutable and therefore threadsafe.
Motivation: this tag was created in part because the instant tag was often incorrectly used for questions about java.time.Instant
.
Resources:
- The official documentation of
java.time.Instant
(javadoc) - ThreeTen Backport - provides a backport of the Java SE 8 date-time classes to Java SE 6 and 7.