class OffsetDateTimeInterval : TimePointInterval<OffsetDateTime>
A half-open interval between two offset date-times based on timeline order.
DateTime.MIN and DateTime.MAX are used as sentinels to indicate an unbounded (ie. infinite) start or end. An OffsetDateTime with either as the date-time component will be treated accordingly, regardless of the offset.
(iosArm64, iosX64, jvm, macosX64)
<init> |
A half-open interval between two offset date-times based on timeline order. <init>(start: OffsetDateTime = UNBOUNDED.start, endExclusive: OffsetDateTime = UNBOUNDED.endExclusive) |
(iosArm64, iosX64, jvm, macosX64)
lengthInMonths |
Get the number of months between the start and end of the interval. A month is considered to have passed if the day of the end month is greater than or equal to the day of the start month. val lengthInMonths: IntMonths |
(iosArm64, iosX64, jvm, macosX64)
lengthInWeeks |
Get the number of whole weeks in the interval. val lengthInWeeks: LongWeeks |
(iosArm64, iosX64, jvm, macosX64)
lengthInYears |
Get the number of years between the start and end of the interval. A year is considered to have passed if twelve full months have passed between the start date and end date. val lengthInYears: IntYears |
(iosArm64, iosX64, jvm, macosX64)
asPeriod |
Convert the interval into a Period of the same length. fun asPeriod(): Period |
(iosArm64, iosX64, jvm, macosX64)
hasUnboundedEnd |
Check if the interval's end is unbounded. In ISO-8601 terminology, this is an "open" end. fun hasUnboundedEnd(): Boolean |
(iosArm64, iosX64, jvm, macosX64)
hasUnboundedStart |
Check if the interval's start is unbounded. In ISO-8601 terminology, this is an "open" start. fun hasUnboundedStart(): Boolean |
(iosArm64, iosX64, jvm, macosX64)
toString |
Convert this interval to a string in ISO-8601 extended format. fun toString(): String |
(iosArm64, iosX64, jvm, macosX64)
EMPTY |
An empty interval. val EMPTY: OffsetDateTimeInterval |
(iosArm64, iosX64, jvm, macosX64)
UNBOUNDED |
An unbounded (ie. infinite) interval. val UNBOUNDED: OffsetDateTimeInterval |
(jvm)
random |
Return a random date-time within the range using the supplied random number generator. fun OffsetDateTimeInterval.random(random: Random): OffsetDateTime |