Duration

Duration

An amount of time measured to the nanosecond.

The maximum value of this type is Num.maxI64 seconds + 999_999_999 nanoseconds, approximately 292 billion years. The minimum value of this type is Num.minI64 seconds, approximately -292 billion years.

zero

Zero duration.

max : Duration

The maximum possible duration, approximately 292 billion years

min : Duration

The minimum possible duration, approximately -292 billion years.

fromNanoseconds : I64 -> Duration

Convert a number of nanoseconds to a duration.

fromMilliseconds : I64 -> Duration

Convert a number of milliseconds to a duration.

fromMicroseconds : I64 -> Duration

Convert a number of microseconds to a duration.

fromSeconds : I64 -> Duration

Convert a number of seconds to a duration.

fromMinutes : I32 -> Duration

Convert a number of minutes to a duration.

fromHours : I32 -> Duration

Convert a number of hours to a duration.

fromDays : I32 -> Duration

Convert a number of days to a duration.

fromWeeks : I32 -> Duration

Convert a number of weeks to a duration.

toNanoseconds : Duration -> I128

Get the number of nanoseconds in the duration.

toWholeSeconds : Duration -> I64

Get the number of whole seconds in the duration, rounded towards zero.

toWholeMinutes : Duration -> I64

Get the number of whole minutes in the duration, rounded towards zero.

toWholeHours : Duration -> I64

Get the number of whole hours in the duration, rounded towards zero.

toWholeDays : Duration -> I64

Get the number of whole days in the duration, rounded towards zero.

toWholeWeeks : Duration -> I64

Get the number of whole weeks in the duration, rounded towards zero.

add : Duration, Duration -> Duration

Add two durations together.