between

fun Centuries.Companion.between(start: Year, endExclusive: Year): Centuries

Returns the number of whole centuries between two years.

fun Centuries.Companion.between(start: YearMonth, endExclusive: YearMonth): Centuries

Returns the number of whole centuries between two year-months.

fun Centuries.Companion.between(start: Date, endExclusive: Date): Centuries

Returns the number of whole centuries between two dates.

fun Centuries.Companion.between(start: DateTime, endExclusive: DateTime): Centuries

Returns the number of whole centuries between two date-times, which are assumed to be in the same time zone.

fun Centuries.Companion.between(start: OffsetDateTime, endExclusive: OffsetDateTime): Centuries

Returns the number of whole centuries between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

fun Centuries.Companion.between(start: ZonedDateTime, endExclusive: ZonedDateTime): Centuries

Returns the number of whole centuries between two date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.

fun Decades.Companion.between(start: Year, endExclusive: Year): Decades

Returns the number of whole decades between two years.

fun Decades.Companion.between(start: YearMonth, endExclusive: YearMonth): Decades

Returns the number of whole decades between two year-months.

fun Decades.Companion.between(start: Date, endExclusive: Date): Decades

Returns the number of whole decades between two dates.

fun Decades.Companion.between(start: DateTime, endExclusive: DateTime): Decades

Returns the number of whole decades between two date-times, which are assumed to be in the same time zone.

fun Decades.Companion.between(start: OffsetDateTime, endExclusive: OffsetDateTime): Decades

Returns the number of whole decades between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

fun Decades.Companion.between(start: ZonedDateTime, endExclusive: ZonedDateTime): Decades

Returns the number of whole decades between two date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.

fun Years.Companion.between(start: Year, endExclusive: Year): Years

Returns the number of years between two years.

fun Years.Companion.between(start: YearMonth, endExclusive: YearMonth): Years

Returns the number of whole years between two year-months.

fun Years.Companion.between(start: Date, endExclusive: Date): Years

Returns the number of whole years between two dates.

fun Years.Companion.between(start: DateTime, endExclusive: DateTime): Years

Returns the number of whole years between two date-times, which are assumed to be in the same time zone.

fun Years.Companion.between(start: OffsetDateTime, endExclusive: OffsetDateTime): Years

Returns the number of whole years between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

fun Years.Companion.between(start: ZonedDateTime, endExclusive: ZonedDateTime): Years

Returns the number of whole years between date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.

fun Months.Companion.between(start: YearMonth, endExclusive: YearMonth): Months

Returns the number of months between two year-months.

fun Months.Companion.between(start: Date, endExclusive: Date): Months

Returns the number of whole months between two dates.

fun Months.Companion.between(start: DateTime, endExclusive: DateTime): Months

Returns the number of whole months between two date-times, which are assumed to be in the same time zone.

fun Months.Companion.between(start: OffsetDateTime, endExclusive: OffsetDateTime): Months

Returns the number of whole months between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

fun Months.Companion.between(start: ZonedDateTime, endExclusive: ZonedDateTime): Months

Returns the number of whole months between two zoned date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.

fun Weeks.Companion.between(start: Date, endExclusive: Date): Weeks

Returns the number of whole weeks between two dates.

fun Weeks.Companion.between(start: DateTime, endExclusive: DateTime): Weeks

Returns the number whole weeks between two date-times, which are assumed to be in the same time zone.

fun Weeks.Companion.between(start: OffsetDateTime, endExclusive: OffsetDateTime): Weeks

Returns the number whole weeks between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

fun Weeks.Companion.between(start: ZonedDateTime, endExclusive: ZonedDateTime): Weeks

Returns the number of whole weeks between two zoned date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.

fun Days.Companion.between(start: Date, endExclusive: Date): Days

Returns the number of days between two dates.

fun Days.Companion.between(start: DateTime, endExclusive: DateTime): Days

Returns the number whole days between two date-times, which are assumed to be in the same time zone.

fun Days.Companion.between(start: OffsetDateTime, endExclusive: OffsetDateTime): Days

Returns the number whole days between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

fun Days.Companion.between(start: ZonedDateTime, endExclusive: ZonedDateTime): Days

Returns the number of whole days between two zoned date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.

fun Hours.Companion.between(start: DateTime, endExclusive: DateTime): Hours

Returns the number of whole hours between two date-times, which are assumed to be at the same UTC offset. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.

fun Hours.Companion.between(start: TimePoint<*>, endExclusive: TimePoint<*>): Hours

Returns the number of whole hours between two time points.

fun Minutes.Companion.between(start: DateTime, endExclusive: DateTime): Minutes

Returns the number of whole minutes between two date-times, which are assumed to be at the same UTC offset. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.

fun Minutes.Companion.between(start: TimePoint<*>, endExclusive: TimePoint<*>): Minutes

Returns the number of whole minutes between two time points.

fun Seconds.Companion.between(start: DateTime, endExclusive: DateTime): Seconds

Returns the number of whole seconds between two date-times, which are assumed to be at the same UTC offset. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.

Throws

if the result overflows

fun Seconds.Companion.between(start: TimePoint<*>, endExclusive: TimePoint<*>): Seconds

Returns the number of whole seconds between two time points.

Throws

if the result overflows

fun Milliseconds.Companion.between(start: DateTime, endExclusive: DateTime): Milliseconds

Returns the number of whole milliseconds between two date-times, which are assumed to be at the same UTC offset. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.

Throws

if the result overflows

fun Milliseconds.Companion.between(start: TimePoint<*>, endExclusive: TimePoint<*>): Milliseconds

Returns the number of whole milliseconds between two time points.

Throws

if the result overflows

fun Microseconds.Companion.between(start: DateTime, endExclusive: DateTime): Microseconds

Returns the number of whole microseconds between two date-times, which are assumed to be at the same UTC offset. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.

Throws

if the result overflows

fun Microseconds.Companion.between(start: TimePoint<*>, endExclusive: TimePoint<*>): Microseconds

Returns the number of whole microseconds between two time points.

Throws

if the result overflows

fun Nanoseconds.Companion.between(start: DateTime, endExclusive: DateTime): Nanoseconds

Returns the number of nanoseconds between two date-times, which are assumed to be at the same UTC offset. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.

Throws

if the result overflows

fun Nanoseconds.Companion.between(start: TimePoint<*>, endExclusive: TimePoint<*>): Nanoseconds

Returns the number of nanoseconds between two time points.

Throws

if the result overflows

fun Duration.Companion.between(start: DateTime, endExclusive: DateTime): Duration

Returns the Duration between two date-times, which are assumed to be at the same UTC offset. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.

fun Duration.Companion.between(start: TimePoint<*>, endExclusive: TimePoint<*>): Duration

Returns the Duration between two time points.

fun Period.Companion.between(start: Date, endExclusive: Date): Period

Returns the Period between two dates.

fun Period.Companion.between(start: DateTime, endExclusive: DateTime): Period

Returns the Period between two date-times, which are assumed to be in the same time zone.

fun Period.Companion.between(start: OffsetDateTime, endExclusive: OffsetDateTime): Period

Returns the Period between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

fun Period.Companion.between(start: ZonedDateTime, endExclusive: ZonedDateTime): Period

Returns the Period between two zoned date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.