java.time.Instant Class

The java.time.Instant class models a single instantaneous point on the time-line.
Following is the declaration for java.time.Instant class −
public final class Instant
   extends Object
      implements Temporal, TemporalAdjuster, Comparable, Serializable

Following are the fields for Java.time.Instant class −
Following are the fields for Java.time.Instant class −
static Instant EPOCH − Constant for the 1970-01-01T00:00:00Z epoch instant.
static Instant EPOCH − Constant for the 1970-01-01T00:00:00Z epoch instant.
static Instant MAX − The maximum supported Instant, '1000000000-12-31T23:59:59.999999999Z'.
static Instant MAX − The maximum supported Instant, '1000000000-12-31T23:59:59.999999999Z'.
static Instant MIN − The minimum supported Instant, '-1000000000-01-01T00:00Z'.
static Instant MIN − The minimum supported Instant, '-1000000000-01-01T00:00Z'.
Adjusts the specified temporal object to have this instant.
Combines this instant with an offset to create an OffsetDateTime.
Combines this instant with a time-zone to create a ZonedDateTime.
Compares this instant to the specified instant.
Checks if this instant is equal to the specified instant.
Obtains an instance of Instant from a temporal object.
Gets the value of the specified field from this instant as an int.
Gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z.
Gets the value of the specified field from this instant as a long.
Gets the number of nanoseconds, later along the time-line, from the start of the second.
Returns a hash code for this instant.
Checks if this instant is after the specified instant.
Checks if this instant is before the specified instant.
Checks if the specified field is supported.
Checks if the specified unit is supported.
Returns a copy of this instant with the specified amount subtracted.
Returns a copy of this instant with the specified amount subtracted.
Returns a copy of this instant with the specified duration in milliseconds subtracted.
Returns a copy of this instant with the specified duration in nanoseconds subtracted.
Returns a copy of this instant with the specified duration in seconds subtracted.
Obtains the current instant from the system clock.
Obtains the current instant from the specified clock.
Obtains an instance of Instant using milliseconds from the epoch of 1970-01-01T00:00:00Z.
Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z.
Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z and nanosecond fraction of second.
Obtains an instance of Instant from a text string such as 2007-12-03T10:15:30.00Z.
Returns a copy of this instant with the specified amount added.
Returns a copy of this instant with the specified amount added.
Returns a copy of this instant with the specified duration in milliseconds added.
Returns a copy of this instant with the specified duration in nanoseconds added.
Returns a copy of this instant with the specified duration in seconds added.
Queries this instant using the specified query.
Gets the range of valid values for the specified field.
Converts this instant to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z.
A string representation of this instant using ISO-8601 representation.
Returns a copy of this Instant truncated to the specified unit.
Calculates the amount of time until another instant in terms of the specified unit.
Returns an adjusted copy of this instant.
Returns a copy of this instant with the specified field set to a new value.
This class inherits methods from the following classes −
Java.lang.Object
 Print
 Add Notes
 Bookmark this page