Skip to main content

Duration

Duration works with the Date type. Similar to the Date implementation, the Duration functions are early and experimental. There is no support yet for date or duration probability distributions.

Durations are stored in Unix milliseconds.

toString

toString: (duration) => string

Units

minutes

minutes: (number) => duration

hours

hours: (number) => duration

days

days: (number) => duration

years

years: (number) => duration

toHours

toHours: (duration) => number

toMinutes

toMinutes: (duration) => number

toDays

toDays: (duration) => number

toYears

toYears: (duration) => number

Algebra

add

add: (duration, duration) => duration

subtract

subtract: (duration, duration) => duration

multiply

multiply: (duration, number) => duration

divide

divide: (duration, number) => duration