An instantaneous point on the time-line.

See java.time.Instant for full documentation

Hierarchy

  • Instant

Constructors

Methods

  • Adjusts the specified temporal object to have this instant.

    Parameters

    Returns Temporal

  • Combines this instant with a time-zone to create a ZonedDateTime.

    Parameters

    Returns ZonedDateTime

  • Compares this instant to the specified instant.

    Parameters

    Returns number

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

    Parameters

    Returns number

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

    Returns number

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

    Parameters

    Returns number

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

    Returns number

  • Checks if this instant is after the specified instant.

    Parameters

    Returns boolean

  • Checks if this instant is before the specified instant.

    Parameters

    Returns boolean

  • Checks if the specified field is supported.

    Parameters

    Returns boolean

  • Checks if the specified unit is supported.

    Parameters

    Returns boolean

  • Returns a copy of this instant with the specified amount subtracted.

    Parameters

    Returns Instant

  • Returns a copy of this instant with the specified amount subtracted.

    Parameters

    Returns Instant

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

    Parameters

    • millisToSubtract: number

    Returns Instant

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

    Parameters

    • nanosToSubtract: number

    Returns Instant

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

    Parameters

    • secondsToSubtract: number

    Returns Instant

  • Returns a copy of this instant with the specified amount added.

    Parameters

    Returns Instant

  • Returns a copy of this instant with the specified amount added.

    Parameters

    Returns Instant

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

    Parameters

    • millisToAdd: number

    Returns Instant

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

    Parameters

    • nanosToAdd: number

    Returns Instant

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

    Parameters

    • secondsToAdd: number

    Returns Instant

  • Queries this instant using the specified query.

    Type Parameters

    • R

    Parameters

    Returns R

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

    Returns number

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

    Parameters

    Returns Instant

  • Calculates the amount of time until another instant in terms of the specified unit.

    Parameters

    Returns number

  • Returns an adjusted copy of this instant.

    Parameters

    Returns Instant

  • Returns a copy of this instant with the specified field set to a new value.

    Parameters

    Returns Instant

  • Obtains an instance of Instant from a temporal object.

    Parameters

    Returns Instant

  • Obtains the current instant from the system clock.

    Parameters

    • Optional clock: Clock

      When present it will return current instant from specified clock

    Returns Instant

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

    Parameters

    • epochMilli: number

    Returns Instant

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

    Parameters

    • epochSecond: number

    Returns Instant

  • Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z and nanosecond fraction of second.

    Parameters

    • epochSecond: number
    • nanoAdjustment: number

    Returns Instant

  • Obtains an instance of Instant from a text string such as 2007-12-03T10:15:30.00Z.

    Parameters

    • text: string

    Returns Instant

Generated using TypeDoc