Skip to content

//core/io.islandtime.ranges/at

at

common

infix fun DateRange.at(zone: TimeZone): ZonedDateTimeInterval

Combines this DateRange with a TimeZone to create a ZonedDateTimeInterval between the start of the first day and the end of the last day in zone.

common

infix fun DateTimeInterval.at(zone: TimeZone): ZonedDateTimeInterval

Combines this DateTimeInterval with a TimeZone to create a ZonedDateTimeInterval where both endpoints are in zone.

Due to daylight savings time transitions, there a few complexities to be aware of. If the local time of either endpoint falls within a gap (meaning it doesn't exist), it will be adjusted forward by the length of the gap. If it falls within an overlap (meaning the local time exists twice), the earlier offset will be used.

common

infix fun InstantInterval.at(zone: TimeZone): ZonedDateTimeInterval

Combines this InstantInterval with a TimeZone to create an equivalent ZonedDateTimeInterval where both endpoints are in zone.