All Implemented Interfaces:
Serializable, Comparable<Instant>, Temporal, TemporalAccessor, TemporalAdjuster

  • Field Summary

    Fields

    Constant for the 1970-01-01T00:00:00Z epoch instant.

    The maximum supported Instant, '1000000000-12-31T23:59:59.999999999Z'.

    The minimum supported Instant, '-1000000000-01-01T00:00Z'.

  • Method Summary

    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.

    int

    Compares this instant to the specified instant.

    boolean

    Checks if this instant is equal to the specified instant.

    Obtains an instance of Instant from a temporal object.

    int

    Gets the value of the specified field from this instant as an int.

    long

    Gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z.

    long

    Gets the value of the specified field from this instant as a long.

    int

    getNano()

    Gets the number of nanoseconds, later along the time-line, from the start of the second.

    int

    hashCode()

    Returns a hash code for this instant.

    boolean

    Checks if this instant is after the specified instant.

    boolean

    Checks if this instant is before the specified instant.

    boolean

    Checks if the specified field is supported.

    boolean

    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.

    minusMillis(long millisToSubtract)

    Returns a copy of this instant with the specified duration in milliseconds subtracted.

    minusNanos(long nanosToSubtract)

    Returns a copy of this instant with the specified duration in nanoseconds subtracted.

    minusSeconds(long secondsToSubtract)

    Returns a copy of this instant with the specified duration in seconds subtracted.

    now()

    Obtains the current instant from the system clock.

    Obtains the current instant from the specified clock.

    ofEpochMilli(long epochMilli)

    Obtains an instance of Instant using milliseconds from the epoch of 1970-01-01T00:00:00Z.

    ofEpochSecond(long epochSecond)

    Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z.

    ofEpochSecond(long epochSecond, long nanoAdjustment)

    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.

    plusMillis(long millisToAdd)

    Returns a copy of this instant with the specified duration in milliseconds added.

    plusNanos(long nanosToAdd)

    Returns a copy of this instant with the specified duration in nanoseconds added.

    Returns a copy of this instant with the specified duration added, with saturated semantics.

    plusSeconds(long secondsToAdd)

    Returns a copy of this instant with the specified duration in seconds added.

    <R> R

    Queries this instant using the specified query.

    Gets the range of valid values for the specified field.

    long

    Converts this instant to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z.

    toString()

    A string representation of this instant using ISO-8601 representation.

    Returns a copy of this Instant truncated to the specified unit.

    Calculates the Duration until another Instant.

    long

    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.

    Methods declared in class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Creates and returns a copy of this object.

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

  • Field Details

    • EPOCH

    • MIN

    • MAX

  • Method Details

    • now

    • now

    • ofEpochSecond

    • ofEpochSecond

    • ofEpochMilli

    • from

    • parse

    • isSupported

    • isSupported

    • range

    • get

    • getLong

    • getEpochSecond

    • getNano

    • with

    • with

    • truncatedTo

    • plus

    • plusSaturating

    • plus

    • plusSeconds

    • plusMillis

    • plusNanos

    • minus

    • minus

    • minusSeconds

    • minusMillis

    • minusNanos

    • query

    • adjustInto

    • until

    • until

    • atOffset

    • atZone

    • toEpochMilli

    • compareTo

    • isAfter

    • isBefore

    • equals

    • hashCode

    • toString