Date Time Interval
class DateTimeInterval(start: DateTime, endExclusive: DateTime) : Interval<DateTime>
Content copied to clipboard
An interval between two date-times, assumed to be at the same offset from UTC.
DateTime.MIN and DateTime.MAX are used as sentinels to indicate an unbounded (ie. infinite) start or end.
Constructors
DateTimeInterval
Link copied to clipboard
fun DateTimeInterval(start: DateTime = UNBOUNDED.start, endExclusive: DateTime = UNBOUNDED.endExclusive)
Content copied to clipboard
Types
Functions
asDuration
Link copied to clipboard
Converts this interval to the Duration between the start and end date-time, assuming they're in the same time zone.
hasBoundedEnd
Link copied to clipboard
hasBoundedStart
Link copied to clipboard
hasUnboundedEnd
Link copied to clipboard
hasUnboundedStart
Link copied to clipboard
isUnbounded
Link copied to clipboard
Properties
endExclusive
Link copied to clipboard
endInclusive
Link copied to clipboard
lengthInDays
Link copied to clipboard
lengthInHours
Link copied to clipboard
lengthInMicroseconds
Link copied to clipboard
lengthInMilliseconds
Link copied to clipboard
lengthInMinutes
Link copied to clipboard
lengthInMonths
Link copied to clipboard
lengthInNanoseconds
Link copied to clipboard
lengthInSeconds
Link copied to clipboard
lengthInWeeks
Link copied to clipboard
lengthInYears
Link copied to clipboard
Extensions
at
Link copied to clipboard
Combines this DateTimeInterval with a TimeZone to create a ZonedDateTimeInterval where both endpoints are in zone.
random
Link copied to clipboard
randomOrNull
Link copied to clipboard
toDateRange
Link copied to clipboard
toInstantIntervalAt
Link copied to clipboard
fun DateTimeInterval.toInstantIntervalAt(zone: TimeZone): InstantInterval
Content copied to clipboard