Returns a copy of this duration with a positive length.
Gets the number of nanoseconds within the second in this duration.
Gets the number of seconds in this duration.
Gets the set of units supported by this duration.
Checks if this duration is negative, excluding zero.
Checks if this duration is zero length.
Returns a copy of this duration with the specified duration subtracted.
Returns a copy of this duration with the specified duration in standard 24 hour days subtracted.
Returns a copy of this duration with the specified duration in hours subtracted.
Returns a copy of this duration with the specified duration in milliseconds subtracted.
Returns a copy of this duration with the specified duration in minutes subtracted.
Returns a copy of this duration with the specified duration in nanoseconds subtracted.
Returns a copy of this duration with the specified duration in seconds subtracted.
Returns a copy of this duration multiplied by the scalar.
Returns a copy of this duration with the length negated.
Returns a copy of this duration with the specified duration added.
Returns a copy of this duration with the specified duration in standard 24 hour days added.
Returns a copy of this duration with the specified duration in hours added.
Returns a copy of this duration with the specified duration in milliseconds added.
Returns a copy of this duration with the specified duration in minutes added.
Returns a copy of this duration with the specified duration in nanoseconds added.
Returns a copy of this duration with the specified duration in seconds added.
Gets the number of days in this duration.
Extracts the number of days in the duration.
Gets the number of hours in this duration.
Extracts the number of hours part in the duration.
Converts this duration to the total length in milliseconds.
Extracts the number of milliseconds part of the duration.
Gets the number of minutes in this duration.
Extracts the number of minutes part in the duration.
Converts this duration to the total length in nanoseconds expressed as a long.
Get the nanoseconds part within seconds of the duration.
Gets the number of seconds in this duration.
Extracts the number of seconds part in the duration.
Returns a copy of this Duration truncated to the specified unit.
Returns a copy of this duration with the specified nano-of-second.
Returns a copy of this duration with the specified amount of seconds.
Static
betweenStatic
fromObtains an instance of Duration from a temporal amount.
Static
ofObtains a Duration representing an amount in the specified unit.
Static
ofObtains a Duration representing a number of standard 24 hour days.
Static
ofStatic
ofStatic
ofObtains a Duration representing a number of standard minutes.
Static
ofStatic
ofObtains a Duration representing a number of seconds and an adjustment in nanoseconds.
Static
parse
A time-based amount of time, such as '34.5 seconds'.
See java.time.Duration for full documentation