Skip to content

//core/io.islandtime/at

at

common

infix fun Year.at(month: Month): YearMonth

Combines a year and month to create a YearMonth.

common

infix fun Date.at(time: Time): DateTime

Combines a Date with a Time to create a DateTime.

common

infix fun DateTime.at(offset: UtcOffset): OffsetDateTime

Combines a local date and time with a UTC offset to create an OffsetDateTime.

common

infix fun Date.at(offsetTime: OffsetTime): OffsetDateTime

Combines a local date with a time and UTC offset to create an OffsetDateTime.

common

infix fun Instant.at(offset: UtcOffset): OffsetDateTime

Combines an instant with a UTC offset to create an OffsetDateTime.

common

infix fun Instant.at(zone: TimeZone): ZonedDateTime

Combines an instant with a time zone to create a ZonedDateTime.

common

infix fun DateTime.at(zone: TimeZone): ZonedDateTime

Combines a local date and time with a time zone to create a ZonedDateTime.

Due to daylight savings time transitions, there a few complexities to be aware of. If the local time 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 Time.at(offset: UtcOffset): OffsetTime

Combines a local time with a UTC offset to create an OffsetTime.