Companion

Since Kotlin

1.6

Properties

Link copied to clipboard

Returns a Duration equal to this Double number of days.

Since Kotlin 1.6

Returns a Duration equal to this Int number of days.

Since Kotlin 1.6

Returns a Duration equal to this Long number of days.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration equal to this Double number of hours.

Since Kotlin 1.6

Returns a Duration equal to this Int number of hours.

Since Kotlin 1.6

Returns a Duration equal to this Long number of hours.

Since Kotlin 1.6
Link copied to clipboard

The duration whose value is positive infinity. It is useful for representing timeouts that should never expire.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration equal to this Double number of microseconds.

Since Kotlin 1.6

Returns a Duration equal to this Int number of microseconds.

Since Kotlin 1.6

Returns a Duration equal to this Long number of microseconds.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration equal to this Double number of milliseconds.

Since Kotlin 1.6

Returns a Duration equal to this Int number of milliseconds.

Since Kotlin 1.6

Returns a Duration equal to this Long number of milliseconds.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration equal to this Double number of minutes.

Since Kotlin 1.6

Returns a Duration equal to this Int number of minutes.

Since Kotlin 1.6

Returns a Duration equal to this Long number of minutes.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration equal to this Double number of nanoseconds.

Since Kotlin 1.6

Returns a Duration equal to this Int number of nanoseconds.

Since Kotlin 1.6

Returns a Duration equal to this Long number of nanoseconds.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration equal to this Double number of seconds.

Since Kotlin 1.6

Returns a Duration equal to this Int number of seconds.

Since Kotlin 1.6

Returns a Duration equal to this Long number of seconds.

Since Kotlin 1.6
Link copied to clipboard

The duration equal to exactly 0 seconds.

Since Kotlin 1.6

Functions

Link copied to clipboard
fun convert(value: Double, sourceUnit: DurationUnit, targetUnit: DurationUnit): Double

Converts the given time duration value expressed in the specified sourceUnit into the specified targetUnit.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration representing the specified value number of days.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration representing the specified value number of hours.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration representing the specified value number of microseconds.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration representing the specified value number of milliseconds.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration representing the specified value number of minutes.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration representing the specified value number of nanoseconds.

Since Kotlin 1.6
Link copied to clipboard
fun parse(value: String): Duration

Parses a string that represents a duration and returns the parsed Duration value.

Since Kotlin 1.6
Link copied to clipboard

Parses a string that represents a duration in ISO-8601 format and returns the parsed Duration value.

Since Kotlin 1.6
Link copied to clipboard

Parses a string that represents a duration in ISO-8601 format and returns the parsed Duration value, or null if the string doesn't represent a duration in ISO-8601 format.

Since Kotlin 1.6
Link copied to clipboard

Parses a string that represents a duration and returns the parsed Duration value, or null if the string doesn't represent a duration in any of the supported formats.

Since Kotlin 1.6
Link copied to clipboard

Returns a Duration representing the specified value number of seconds.

Since Kotlin 1.6