A time-based amount of time, such as '34.5 seconds'.

See java.time.Duration for full documentation

Hierarchy

  • Duration

Constructors

Methods

  • Returns a copy of this duration with a positive length.

    Returns Duration

  • Adds this duration to the specified temporal object.

    Parameters

    Returns Temporal

  • Compares this duration to the specified Duration.

    Parameters

    Returns number

  • Returns a copy of this duration divided by the specified value.

    Parameters

    • divisor: number

    Returns Duration

  • Returns number of whole times a specified Duration occurs within this Duration.

    Parameters

    Returns number

  • Gets the value of the requested unit.

    Parameters

    Returns number

  • Gets the number of nanoseconds within the second in this duration.

    Returns number

  • Gets the number of seconds in this duration.

    Returns number

  • Gets the set of units supported by this duration.

    Returns TemporalUnit[]

  • Checks if this duration is negative, excluding zero.

    Returns boolean

  • Checks if this duration is zero length.

    Returns boolean

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

    Parameters

    Returns Duration

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

    Parameters

    Returns Duration

  • Returns a copy of this duration with the specified duration in standard 24 hour days subtracted.

    Parameters

    • daysToSubtract: number

    Returns Duration

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

    Parameters

    • hoursToSubtract: number

    Returns Duration

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

    Parameters

    • millisToSubtract: number

    Returns Duration

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

    Parameters

    • minutesToSubtract: number

    Returns Duration

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

    Parameters

    • nanosToSubtract: number

    Returns Duration

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

    Parameters

    • secondsToSubtract: number

    Returns Duration

  • Returns a copy of this duration multiplied by the scalar.

    Parameters

    • multiplicand: number

    Returns Duration

  • Returns a copy of this duration with the length negated.

    Returns Duration

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

    Parameters

    Returns Duration

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

    Parameters

    Returns Duration

  • Returns a copy of this duration with the specified duration in standard 24 hour days added.

    Parameters

    • daysToAdd: number

    Returns Duration

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

    Parameters

    • hoursToAdd: number

    Returns Duration

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

    Parameters

    • millisToAdd: number

    Returns Duration

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

    Parameters

    • minutesToAdd: number

    Returns Duration

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

    Parameters

    • nanosToAdd: number

    Returns Duration

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

    Parameters

    • secondsToAdd: number

    Returns Duration

  • Subtracts this duration from the specified temporal object.

    Parameters

    Returns Temporal

  • Gets the number of days in this duration.

    Returns number

  • Extracts the number of days in the duration.

    Returns number

  • Gets the number of hours in this duration.

    Returns number

  • Extracts the number of hours part in the duration.

    Returns number

  • Converts this duration to the total length in milliseconds.

    Returns number

  • Extracts the number of milliseconds part of the duration.

    Returns number

  • Gets the number of minutes in this duration.

    Returns number

  • Extracts the number of minutes part in the duration.

    Returns number

  • Converts this duration to the total length in nanoseconds expressed as a long.

    Returns number

  • Get the nanoseconds part within seconds of the duration.

    Returns number

  • Gets the number of seconds in this duration.

    Returns number

  • Extracts the number of seconds part in the duration.

    Returns number

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

    Parameters

    Returns Duration

  • Returns a copy of this duration with the specified nano-of-second.

    Parameters

    • nanoOfSecond: number

    Returns Duration

  • Returns a copy of this duration with the specified amount of seconds.

    Parameters

    • seconds: number

    Returns Duration

  • Obtains a Duration representing the duration between two temporal objects.

    Parameters

    Returns Duration

  • Obtains an instance of Duration from a temporal amount.

    Parameters

    Returns Duration

  • Obtains a Duration representing an amount in the specified unit.

    Parameters

    Returns Duration

  • Obtains a Duration representing a number of standard 24 hour days.

    Parameters

    • days: number

    Returns Duration

  • Obtains a Duration representing a number of standard hours.

    Parameters

    • hours: number

    Returns Duration

  • Obtains a Duration representing a number of milliseconds.

    Parameters

    • millis: number

    Returns Duration

  • Obtains a Duration representing a number of standard minutes.

    Parameters

    • minutes: number

    Returns Duration

  • Obtains a Duration representing a number of nanoseconds.

    Parameters

    • nanos: number

    Returns Duration

  • Obtains a Duration representing a number of seconds.

    Parameters

    • seconds: number

    Returns Duration

  • Obtains a Duration representing a number of seconds and an adjustment in nanoseconds.

    Parameters

    • seconds: number
    • nanoAdjustment: number

    Returns Duration

  • Obtains a Duration from a text string such as PnDTnHnMn.nS.

    Parameters

    • text: string

    Returns Duration

Generated using TypeDoc