Package io.islandtime.measures

Classes related to the measurement of time, including Duration, Period, and more specific units, such as IntHours or LongYears.

Types

Duration
Link copied to clipboard
common
class Duration : Comparable<Duration>
A duration of time at nanosecond precision.
IntCenturies
Link copied to clipboard
common
inline class IntCenturies(value: Int) : Comparable<IntCenturies>
A number of centuries.
IntDays
Link copied to clipboard
common
inline class IntDays(value: Int) : Comparable<IntDays>
A number of days.
IntDecades
Link copied to clipboard
common
inline class IntDecades(value: Int) : Comparable<IntDecades>
A number of decades.
IntHours
Link copied to clipboard
common
inline class IntHours(value: Int) : Comparable<IntHours>
A number of hours.
IntMicroseconds
Link copied to clipboard
common
inline class IntMicroseconds(value: Int) : Comparable<IntMicroseconds>
A number of microseconds.
IntMilliseconds
Link copied to clipboard
common
inline class IntMilliseconds(value: Int) : Comparable<IntMilliseconds>
A number of milliseconds.
IntMinutes
Link copied to clipboard
common
inline class IntMinutes(value: Int) : Comparable<IntMinutes>
A number of minutes.
IntMonths
Link copied to clipboard
common
inline class IntMonths(value: Int) : Comparable<IntMonths>
A number of months.
IntNanoseconds
Link copied to clipboard
common
inline class IntNanoseconds(value: Int) : Comparable<IntNanoseconds>
A number of nanoseconds.
IntSeconds
Link copied to clipboard
common
inline class IntSeconds(value: Int) : Comparable<IntSeconds>
A number of seconds.
IntWeeks
Link copied to clipboard
common
inline class IntWeeks(value: Int) : Comparable<IntWeeks>
A number of weeks.
IntYears
Link copied to clipboard
common
inline class IntYears(value: Int) : Comparable<IntYears>
A number of years.
LongCenturies
Link copied to clipboard
common
inline class LongCenturies(value: Long) : Comparable<LongCenturies>
A number of centuries.
LongDays
Link copied to clipboard
common
inline class LongDays(value: Long) : Comparable<LongDays>
A number of days.
LongDecades
Link copied to clipboard
common
inline class LongDecades(value: Long) : Comparable<LongDecades>
A number of decades.
LongHours
Link copied to clipboard
common
inline class LongHours(value: Long) : Comparable<LongHours>
A number of hours.
LongMicroseconds
Link copied to clipboard
common
inline class LongMicroseconds(value: Long) : Comparable<LongMicroseconds>
A number of microseconds.
LongMilliseconds
Link copied to clipboard
common
inline class LongMilliseconds(value: Long) : Comparable<LongMilliseconds>
A number of milliseconds.
LongMinutes
Link copied to clipboard
common
inline class LongMinutes(value: Long) : Comparable<LongMinutes>
A number of minutes.
LongMonths
Link copied to clipboard
common
inline class LongMonths(value: Long) : Comparable<LongMonths>
A number of months.
LongNanoseconds
Link copied to clipboard
common
inline class LongNanoseconds(value: Long) : Comparable<LongNanoseconds>
A number of nanoseconds.
LongSeconds
Link copied to clipboard
common
inline class LongSeconds(value: Long) : Comparable<LongSeconds>
A number of seconds.
LongWeeks
Link copied to clipboard
common
inline class LongWeeks(value: Long) : Comparable<LongWeeks>
A number of weeks.
LongYears
Link copied to clipboard
common
inline class LongYears(value: Long) : Comparable<LongYears>
A number of years.
Period
Link copied to clipboard
common
class Period
A date-based period of time, such as "2 years, 5 months, 16 days".
TimeUnit
Link copied to clipboard
common
enum TimeUnit : Enum<TimeUnit>
A unit of time measurement.

Functions

abs
Link copied to clipboard
common
fun abs(duration: Duration): Duration
Returns the absolute value of duration.
asDuration
Link copied to clipboard
common
fun IntDays.asDuration(): Duration
fun IntHours.asDuration(): Duration
fun IntMicroseconds.asDuration(): Duration
fun IntMilliseconds.asDuration(): Duration
fun IntMinutes.asDuration(): Duration
fun IntNanoseconds.asDuration(): Duration
fun IntSeconds.asDuration(): Duration
fun LongDays.asDuration(): Duration
fun LongHours.asDuration(): Duration
fun LongMicroseconds.asDuration(): Duration
fun LongMilliseconds.asDuration(): Duration
fun LongMinutes.asDuration(): Duration
fun LongNanoseconds.asDuration(): Duration
fun LongSeconds.asDuration(): Duration
asPeriod
Link copied to clipboard
common
fun IntDays.asPeriod(): Period
Converts this duration into a Period with the same number of days.
fun IntMonths.asPeriod(): Period
Converts this duration into a Period with the same number of months.
fun IntWeeks.asPeriod(): Period
Converts this duration into a Period with the same number of weeks.
fun IntYears.asPeriod(): Period
Converts this duration into a Period with the same number of years.
fun LongDays.asPeriod(): Period
Converts this duration into a Period with the same number of days.
fun LongMonths.asPeriod(): Period
Converts this duration into a Period with the same number of months.
fun LongWeeks.asPeriod(): Period
Converts this duration into a Period with the same number of weeks.
fun LongYears.asPeriod(): Period
Converts this duration into a Period with the same number of years.
durationOf
Link copied to clipboard
common
fun durationOf(days: IntDays): Duration
Creates a Duration of 24-hour days.
fun durationOf(hours: IntHours): Duration
Creates a Duration of hours.
fun durationOf(microseconds: IntMicroseconds): Duration
Creates a Duration of microseconds.
fun durationOf(milliseconds: IntMilliseconds): Duration
Creates a Duration of milliseconds.
fun durationOf(minutes: IntMinutes): Duration
Creates a Duration of minutes.
fun durationOf(nanoseconds: IntNanoseconds): Duration
Creates a Duration of nanoseconds.
fun durationOf(seconds: IntSeconds): Duration
Creates a Duration of seconds.
fun durationOf(days: LongDays): Duration
Creates a Duration of 24-hour days.
fun durationOf(hours: LongHours): Duration
Creates a Duration of hours.
fun durationOf(microseconds: LongMicroseconds): Duration
Creates a Duration of microseconds.
fun durationOf(milliseconds: LongMilliseconds): Duration
Creates a Duration of milliseconds.
fun durationOf(minutes: LongMinutes): Duration
Creates a Duration of minutes.
fun durationOf(nanoseconds: LongNanoseconds): Duration
Creates a Duration of nanoseconds.
fun durationOf(seconds: LongSeconds): Duration
Creates a Duration of seconds.
fun durationOf(seconds: IntSeconds, nanoseconds: IntNanoseconds): Duration
Creates a Duration.
fun durationOf(seconds: IntSeconds, nanoseconds: LongNanoseconds): Duration
Creates a Duration.
fun durationOf(seconds: LongSeconds, nanoseconds: IntNanoseconds): Duration
Creates a Duration.
fun durationOf(seconds: LongSeconds, nanoseconds: LongNanoseconds): Duration
Creates a Duration.
minus
Link copied to clipboard
common
operator fun IntDays.minus(period: Period): Period
operator fun IntMonths.minus(period: Period): Period
operator fun IntWeeks.minus(period: Period): Period
operator fun IntYears.minus(period: Period): Period
operator fun LongDays.minus(period: Period): Period
operator fun LongMonths.minus(period: Period): Period
operator fun LongWeeks.minus(period: Period): Period
operator fun LongYears.minus(period: Period): Period
periodOf
Link copied to clipboard
common
fun periodOf(days: IntDays): Period
Creates a Period.
fun periodOf(weeks: IntWeeks): Period
Creates a Period.
fun periodOf(months: IntMonths, days: IntDays = 0.days): Period
Creates a Period.
fun periodOf(years: IntYears, days: IntDays): Period
Creates a Period.
fun periodOf(years: IntYears, months: IntMonths = 0.months, days: IntDays = 0.days): Period
Creates a Period.
plus
Link copied to clipboard
common
operator fun IntDays.plus(period: Period): Period
operator fun IntMonths.plus(period: Period): Period
operator fun IntWeeks.plus(period: Period): Period
operator fun IntYears.plus(period: Period): Period
operator fun LongDays.plus(period: Period): Period
operator fun LongMonths.plus(period: Period): Period
operator fun LongWeeks.plus(period: Period): Period
operator fun LongYears.plus(period: Period): Period
times
Link copied to clipboard
common
operator fun Int.times(duration: Duration): Duration
Multiplies this value by a duration.
operator fun Int.times(centuries: IntCenturies): IntCenturies
Multiplies this value by a duration of centuries.
operator fun Int.times(days: IntDays): IntDays
Multiplies this value by a duration of days.
operator fun Int.times(decades: IntDecades): IntDecades
Multiplies this value by a duration of decades.
operator fun Int.times(hours: IntHours): IntHours
Multiplies this value by a duration of hours.
operator fun Int.times(microseconds: IntMicroseconds): LongMicroseconds
Multiplies this value by a duration of microseconds.
operator fun Int.times(milliseconds: IntMilliseconds): LongMilliseconds
Multiplies this value by a duration of milliseconds.
operator fun Int.times(minutes: IntMinutes): IntMinutes
Multiplies this value by a duration of minutes.
operator fun Int.times(months: IntMonths): IntMonths
Multiplies this value by a duration of months.
operator fun Int.times(nanoseconds: IntNanoseconds): LongNanoseconds
Multiplies this value by a duration of nanoseconds.
operator fun Int.times(seconds: IntSeconds): IntSeconds
Multiplies this value by a duration of seconds.
operator fun Int.times(weeks: IntWeeks): IntWeeks
Multiplies this value by a duration of weeks.
operator fun Int.times(years: IntYears): IntYears
Multiplies this value by a duration of years.
operator fun Int.times(centuries: LongCenturies): LongCenturies
Multiplies this value by a duration of centuries.
operator fun Int.times(days: LongDays): LongDays
Multiplies this value by a duration of days.
operator fun Int.times(decades: LongDecades): LongDecades
Multiplies this value by a duration of decades.
operator fun Int.times(hours: LongHours): LongHours
Multiplies this value by a duration of hours.
operator fun Int.times(microseconds: LongMicroseconds): LongMicroseconds
Multiplies this value by a duration of microseconds.
operator fun Int.times(milliseconds: LongMilliseconds): LongMilliseconds
Multiplies this value by a duration of milliseconds.
operator fun Int.times(minutes: LongMinutes): LongMinutes
Multiplies this value by a duration of minutes.
operator fun Int.times(months: LongMonths): LongMonths
Multiplies this value by a duration of months.
operator fun Int.times(nanoseconds: LongNanoseconds): LongNanoseconds
Multiplies this value by a duration of nanoseconds.
operator fun Int.times(seconds: LongSeconds): LongSeconds
Multiplies this value by a duration of seconds.
operator fun Int.times(weeks: LongWeeks): LongWeeks
Multiplies this value by a duration of weeks.
operator fun Int.times(years: LongYears): LongYears
Multiplies this value by a duration of years.
operator fun Int.times(period: Period): Period
operator fun Long.times(centuries: IntCenturies): LongCenturies
Multiplies this value by a duration of centuries.
operator fun Long.times(days: IntDays): LongDays
Multiplies this value by a duration of days.
operator fun Long.times(decades: IntDecades): LongDecades
Multiplies this value by a duration of decades.
operator fun Long.times(hours: IntHours): LongHours
Multiplies this value by a duration of hours.
operator fun Long.times(microseconds: IntMicroseconds): LongMicroseconds
Multiplies this value by a duration of microseconds.
operator fun Long.times(milliseconds: IntMilliseconds): LongMilliseconds
Multiplies this value by a duration of milliseconds.
operator fun Long.times(minutes: IntMinutes): LongMinutes
Multiplies this value by a duration of minutes.
operator fun Long.times(months: IntMonths): LongMonths
Multiplies this value by a duration of months.
operator fun Long.times(nanoseconds: IntNanoseconds): LongNanoseconds
Multiplies this value by a duration of nanoseconds.
operator fun Long.times(seconds: IntSeconds): LongSeconds
Multiplies this value by a duration of seconds.
operator fun Long.times(weeks: IntWeeks): LongWeeks
Multiplies this value by a duration of weeks.
operator fun Long.times(years: IntYears): LongYears
Multiplies this value by a duration of years.
operator fun Long.times(centuries: LongCenturies): LongCenturies
Multiplies this value by a duration of centuries.
operator fun Long.times(days: LongDays): LongDays
Multiplies this value by a duration of days.
operator fun Long.times(decades: LongDecades): LongDecades
Multiplies this value by a duration of decades.
operator fun Long.times(hours: LongHours): LongHours
Multiplies this value by a duration of hours.
operator fun Long.times(microseconds: LongMicroseconds): LongMicroseconds
Multiplies this value by a duration of microseconds.
operator fun Long.times(milliseconds: LongMilliseconds): LongMilliseconds
Multiplies this value by a duration of milliseconds.
operator fun Long.times(minutes: LongMinutes): LongMinutes
Multiplies this value by a duration of minutes.
operator fun Long.times(months: LongMonths): LongMonths
Multiplies this value by a duration of months.
operator fun Long.times(nanoseconds: LongNanoseconds): LongNanoseconds
Multiplies this value by a duration of nanoseconds.
operator fun Long.times(seconds: LongSeconds): LongSeconds
Multiplies this value by a duration of seconds.
operator fun Long.times(weeks: LongWeeks): LongWeeks
Multiplies this value by a duration of weeks.
operator fun Long.times(years: LongYears): LongYears
Multiplies this value by a duration of years.
toDuration
Link copied to clipboard
common
fun String.toDuration(): Duration
Converts an ISO-8601 duration string to a Duration.
fun String.toDuration(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): Duration
Converts a string to a Duration using parser.
toIslandDays
Link copied to clipboard
common
fun Duration.toIslandDays(): LongDays
Converts this duration to Island Time LongDays.
toIslandDuration
Link copied to clipboard
common
fun Duration.toIslandDuration(): Duration
Converts this duration to an equivalent Island Time Duration.
toIslandHours
Link copied to clipboard
common
fun Duration.toIslandHours(): LongHours
Converts this duration to Island Time LongHours.
toIslandMicroseconds
Link copied to clipboard
common
Converts this duration to Island Time LongMicroseconds.
toIslandMilliseconds
Link copied to clipboard
common
Converts this duration to Island Time LongMilliseconds.
toIslandMinutes
Link copied to clipboard
common
fun Duration.toIslandMinutes(): LongMinutes
Converts this duration to Island Time LongMinutes.
toIslandNanoseconds
Link copied to clipboard
common
fun Duration.toIslandNanoseconds(): LongNanoseconds
Converts this duration to Island Time LongNanoseconds.
toIslandSeconds
Link copied to clipboard
common
fun Duration.toIslandSeconds(): LongSeconds
Converts this duration to Island Time LongSeconds.
toPeriod
Link copied to clipboard
common
fun String.toPeriod(): Period
fun String.toPeriod(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): Period

Properties

centuries
Link copied to clipboard
common
val Int.centuries: IntCenturies
Converts this value to a duration of centuries.
centuries
Link copied to clipboard
common
val Long.centuries: LongCenturies
Converts this value to a duration of centuries.
days
Link copied to clipboard
common
val Int.days: IntDays
Converts this value to a duration of days.
days
Link copied to clipboard
common
val Long.days: LongDays
Converts this value to a duration of days.
decades
Link copied to clipboard
common
val Int.decades: IntDecades
Converts this value to a duration of decades.
decades
Link copied to clipboard
common
val Long.decades: LongDecades
Converts this value to a duration of decades.
hours
Link copied to clipboard
common
val Int.hours: IntHours
Converts this value to a duration of hours.
hours
Link copied to clipboard
common
val Long.hours: LongHours
Converts this value to a duration of hours.
microseconds
Link copied to clipboard
common
val Int.microseconds: IntMicroseconds
Converts this value to a duration of microseconds.
microseconds
Link copied to clipboard
common
val Long.microseconds: LongMicroseconds
Converts this value to a duration of microseconds.
milliseconds
Link copied to clipboard
common
val Int.milliseconds: IntMilliseconds
Converts this value to a duration of milliseconds.
milliseconds
Link copied to clipboard
common
val Long.milliseconds: LongMilliseconds
Converts this value to a duration of milliseconds.
minutes
Link copied to clipboard
common
val Int.minutes: IntMinutes
Converts this value to a duration of minutes.
minutes
Link copied to clipboard
common
val Long.minutes: LongMinutes
Converts this value to a duration of minutes.
months
Link copied to clipboard
common
val Int.months: IntMonths
Converts this value to a duration of months.
months
Link copied to clipboard
common
val Long.months: LongMonths
Converts this value to a duration of months.
nanoseconds
Link copied to clipboard
common
val Int.nanoseconds: IntNanoseconds
Converts this value to a duration of nanoseconds.
nanoseconds
Link copied to clipboard
common
val Long.nanoseconds: LongNanoseconds
Converts this value to a duration of nanoseconds.
seconds
Link copied to clipboard
common
val Int.seconds: IntSeconds
Converts this value to a duration of seconds.
seconds
Link copied to clipboard
common
val Long.seconds: LongSeconds
Converts this value to a duration of seconds.
weeks
Link copied to clipboard
common
val Int.weeks: IntWeeks
Converts this value to a duration of weeks.
weeks
Link copied to clipboard
common
val Long.weeks: LongWeeks
Converts this value to a duration of weeks.
years
Link copied to clipboard
common
val Int.years: IntYears
Converts this value to a duration of years.
years
Link copied to clipboard
common
val Long.years: LongYears
Converts this value to a duration of years.