Package io.islandtime

Date-time primitives and core concepts, including classes such as Date, Time, Instant, and ZonedDateTime.

Types

Date
Link copied to clipboard
common
class Date(year: Int, month: Month, day: Int) : Comparable<Date>

A date in an ambiguous region.

DateTime
Link copied to clipboard
common
class DateTime(date: Date, time: Time) : Comparable<DateTime>

A date and time of day in an ambiguous region.

DateTimeException
Link copied to clipboard
common
open class DateTimeException(message: String?, cause: Throwable?) : Exception
DayOfWeek
Link copied to clipboard
common
enum DayOfWeek : Enum<DayOfWeek>

A day of the week.

Instant
Link copied to clipboard
common
class Instant : TimePoint<Instant> , Comparable<Instant>

An instant in time with nanosecond-precision.

IslandTime
Link copied to clipboard
common
object IslandTime

Global configuration for Island Time.

Month
Link copied to clipboard
common
enum Month : Enum<Month>

A month of the year.

OffsetConversionStrategy
Link copied to clipboard
common
enum OffsetConversionStrategy : Enum<OffsetConversionStrategy>

Strategy to use when converting a local date-time accompanied by a UtcOffset to a date and time that are valid according to the rules of a TimeZone.

OffsetDateTime
Link copied to clipboard
common
class OffsetDateTime(dateTime: DateTime, offset: UtcOffset) : TimePoint<OffsetDateTime>

A date and time of day with an offset from UTC.

OffsetTime
Link copied to clipboard
common
class OffsetTime(time: Time, offset: UtcOffset)

A time of day with an offset from UTC.

PlatformInstant
Link copied to clipboard
common
class PlatformInstant

A platform-specific representation of an instant in time.

typealias PlatformInstant = <ERROR CLASS>
typealias PlatformInstant = Instant
Time
Link copied to clipboard
common
class Time(hour: Int, minute: Int, second: Int, nanosecond: Int) : Comparable<Time>

A time of day in an ambiguous region.

TimeZone
Link copied to clipboard
common
sealed class TimeZone : Comparable<TimeZone>

A time zone.

UtcOffset
Link copied to clipboard
common
value class UtcOffset : Comparable<UtcOffset>

The time shift between a local time and UTC.

Year
Link copied to clipboard
common
value class Year(value: Int) : Comparable<Year>

A year as defined by ISO-8601.

YearMonth
Link copied to clipboard
common
class YearMonth(year: Int, month: Month) : Comparable<YearMonth>

A month in a particular year.

ZonedDateTime
Link copied to clipboard
common
class ZonedDateTime : TimePoint<ZonedDateTime>

A date and time of day in a particular region.

Functions

asTimeZone
Link copied to clipboard
common
fun UtcOffset.asTimeZone(): TimeZone

Converts this UtcOffset into a fixed-offset TimeZone.

asUtcOffset
Link copied to clipboard
common
fun Hours.asUtcOffset(): UtcOffset

Converts a duration of hours into a UtcOffset of the same length.

fun Minutes.asUtcOffset(): UtcOffset

Converts a duration of minutes into a UtcOffset of the same length.

fun Seconds.asUtcOffset(): UtcOffset

Converts a duration of seconds into a UtcOffset of the same length.

asZonedDateTime
Link copied to clipboard
common
fun OffsetDateTime.asZonedDateTime(): ZonedDateTime

Converts this OffsetDateTime to an equivalent ZonedDateTime using a fixed-offset time zone.

at
Link copied to clipboard
common
infix fun Date.at(offsetTime: OffsetTime): OffsetDateTime

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

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

Combines a Date with a Time to create a DateTime.

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

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

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

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

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

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

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

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

infix fun Time.at(offset: UtcOffset): OffsetTime

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

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

Combines a year and month to create a YearMonth.

atDay
Link copied to clipboard
common
fun YearMonth.atDay(day: Int): Date

Combines a YearMonth with a day of the month to create a Date.

atMonth
Link copied to clipboard
common
fun Year.atMonth(number: Int): YearMonth

Combines a year and month number to create a YearMonth.

atTime
Link copied to clipboard
common
fun Date.atTime(hour: Int, minute: Int, second: Int = 0, nanosecond: Int = 0): DateTime

Combines a Date with a time to create a DateTime.

between
Link copied to clipboard
common
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: 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: 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 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 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: 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: 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 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 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 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.

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

Returns the number of whole microseconds between two time points.

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.

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

Returns the number of whole milliseconds 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 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: YearMonth, endExclusive: YearMonth): Months

Returns the number of months between two year-months.

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 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.

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

Returns the number of nanoseconds 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.

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.

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

Returns the number of whole seconds between two time points.

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 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: 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: 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.

Date
Link copied to clipboard
common
fun Date(year: Int, dayOfYear: Int): Date

Creates a Date from a year and day of year

endOfDayAt
Link copied to clipboard
common
fun Date.endOfDayAt(zone: TimeZone): ZonedDateTime

The ZonedDateTime at the last representable instant of the day in zone, taking into account any daylight savings transitions.

endOfWeek
Link copied to clipboard
common
fun Date.endOfWeek(settings: WeekSettings): Date

The date at the end of the week that this date falls in. The first day of the week will be determined by settings. The first day of the week will be determined by the system settings. The first day of the week will be determined by the system settings. This may differ from the first day of the week associated with the default locale on platforms that allow this to be customized.

fun Date.endOfWeek(locale: Locale): Date

The date at the end of the week that this date falls in. The first day of the week will be determined by locale.

fun DateTime.endOfWeek(settings: WeekSettings): DateTime

The date-time at the last representable instant of the week that this date-time falls in. The first day of the week will be determined by the system settings. This may differ from the first day of the week associated with the default locale on platforms that allow this to be customized.

fun DateTime.endOfWeek(locale: Locale): DateTime
fun OffsetDateTime.endOfWeek(locale: Locale): OffsetDateTime
fun ZonedDateTime.endOfWeek(locale: Locale): ZonedDateTime

The date-time at the last representable instant of the week that this date-time falls in. The first day of the week will be determined by locale.

fun OffsetDateTime.endOfWeek(settings: WeekSettings): OffsetDateTime
fun ZonedDateTime.endOfWeek(settings: WeekSettings): ZonedDateTime

The date-time at the last representable instant of the week that this date-time falls in. The first day of the week will be determined by the user's system settings. This may differ from the first day of the week associated with the default locale on platforms that allow the user to customize this.

fromWeekDate
Link copied to clipboard
common
fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int): Date

Creates a Date from an ISO week date.

fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int, settings: WeekSettings): Date

Creates a Date from a week date representation using the week definition in settings.

fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int, locale: Locale): Date

Creates a Date from a week date representation using the week definition associated with the provided locale.

Instant
Link copied to clipboard
common
fun Instant(millisecondsSinceUnixEpoch: Milliseconds): Instant

Creates the Instant represented by a number of milliseconds relative to the Unix epoch of 1970-01-01T00:00Z.

fun Instant(secondsSinceUnixEpoch: Seconds): Instant

Creates the Instant represented by a number of seconds relative to the Unix epoch of 1970-01-01T00:00Z.

fun Instant(secondsSinceUnixEpoch: Seconds, nanosecondAdjustment: Nanoseconds): Instant

Creates the Instant represented by a number of seconds and additional nanoseconds relative to the Unix epoch of 1970-01-01T00:00Z.

next
Link copied to clipboard
common
fun Date.next(dayOfWeek: DayOfWeek): Date

The next date after this one that falls on dayOfWeek.

fun DateTime.next(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.next(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.next(dayOfWeek: DayOfWeek): ZonedDateTime

The next date-time after this one that falls on dayOfWeek.

nextOrSame
Link copied to clipboard
common
fun Date.nextOrSame(dayOfWeek: DayOfWeek): Date

The next date that falls on dayOfWeek, or this date if it falls on the same day.

fun DateTime.nextOrSame(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.nextOrSame(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.nextOrSame(dayOfWeek: DayOfWeek): ZonedDateTime

The next date-time that falls on dayOfWeek, or this date-time if it falls on the same day.

previous
Link copied to clipboard
common
fun Date.previous(dayOfWeek: DayOfWeek): Date

The last date before this one that falls on dayOfWeek.

fun DateTime.previous(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.previous(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.previous(dayOfWeek: DayOfWeek): ZonedDateTime

The last date-time before this one that falls on dayOfWeek.

previousOrSame
Link copied to clipboard
common
fun Date.previousOrSame(dayOfWeek: DayOfWeek): Date

The previous date that falls on dayOfWeek, or this date if it falls on the same day.

fun DateTime.previousOrSame(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.previousOrSame(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.previousOrSame(dayOfWeek: DayOfWeek): ZonedDateTime

The previous date-time that falls on dayOfWeek, or this date-time if it falls on the same day.

roundedDownTo
Link copied to clipboard
common
fun DateTime.roundedDownTo(unit: TimeUnit): DateTime
fun OffsetDateTime.roundedDownTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.roundedDownTo(unit: TimeUnit): ZonedDateTime

Returns this date-time, rounded down to match the precision of a given unit.

fun Instant.roundedDownTo(unit: TimeUnit): Instant

Returns this instant, rounded down to match the precision of a given unit.

fun OffsetTime.roundedDownTo(unit: TimeUnit): OffsetTime
fun Time.roundedDownTo(unit: TimeUnit): Time

Returns this time, rounded down to match the precision of a given unit.

roundedDownToNearest
Link copied to clipboard
common
fun DateTime.roundedDownToNearest(increment: Hours): DateTime
fun OffsetDateTime.roundedDownToNearest(increment: Hours): OffsetDateTime
fun ZonedDateTime.roundedDownToNearest(increment: Hours): ZonedDateTime

Returns this date-time, rounded down to the nearest hour that satisfies the increment.

fun DateTime.roundedDownToNearest(increment: Microseconds): DateTime
fun OffsetDateTime.roundedDownToNearest(increment: Microseconds): OffsetDateTime
fun ZonedDateTime.roundedDownToNearest(increment: Microseconds): ZonedDateTime

Returns this date-time, rounded down to the nearest microsecond that satisfies the increment.

fun DateTime.roundedDownToNearest(increment: Milliseconds): DateTime
fun OffsetDateTime.roundedDownToNearest(increment: Milliseconds): OffsetDateTime
fun ZonedDateTime.roundedDownToNearest(increment: Milliseconds): ZonedDateTime

Returns this date-time, rounded down to the nearest millisecond that satisfies the increment.

fun DateTime.roundedDownToNearest(increment: Minutes): DateTime
fun OffsetDateTime.roundedDownToNearest(increment: Minutes): OffsetDateTime
fun ZonedDateTime.roundedDownToNearest(increment: Minutes): ZonedDateTime

Returns this date-time, rounded down to the nearest minute that satisfies the increment.

fun DateTime.roundedDownToNearest(increment: Nanoseconds): DateTime
fun OffsetDateTime.roundedDownToNearest(increment: Nanoseconds): OffsetDateTime
fun ZonedDateTime.roundedDownToNearest(increment: Nanoseconds): ZonedDateTime

Returns this date-time, rounded down to the nearest nanosecond that satisfies the increment.

fun DateTime.roundedDownToNearest(increment: Seconds): DateTime
fun OffsetDateTime.roundedDownToNearest(increment: Seconds): OffsetDateTime
fun ZonedDateTime.roundedDownToNearest(increment: Seconds): ZonedDateTime

Returns this date-time, rounded down to the nearest second that satisfies the increment.

fun Instant.roundedDownToNearest(increment: Hours): Instant

Returns this instant, rounded down to the nearest hour that satisfies the increment.

fun Instant.roundedDownToNearest(increment: Microseconds): Instant

Returns this instant, rounded down to the nearest microsecond that satisfies the increment.

fun Instant.roundedDownToNearest(increment: Milliseconds): Instant

Returns this instant, rounded down to the nearest millisecond that satisfies the increment.

fun Instant.roundedDownToNearest(increment: Minutes): Instant

Returns this instant, rounded down to the nearest minute that satisfies the increment.

fun Instant.roundedDownToNearest(increment: Nanoseconds): Instant

Returns this instant, rounded down to the nearest nanosecond that satisfies the increment.

fun Instant.roundedDownToNearest(increment: Seconds): Instant

Returns this instant, rounded down to the nearest second that satisfies the increment.

fun OffsetTime.roundedDownToNearest(increment: Hours): OffsetTime
fun Time.roundedDownToNearest(increment: Hours): Time

Returns this time, rounded down to the nearest hour that satisfies the increment.

fun OffsetTime.roundedDownToNearest(increment: Microseconds): OffsetTime
fun Time.roundedDownToNearest(increment: Microseconds): Time

Returns this time, rounded down to the nearest microsecond that satisfies the increment.

fun OffsetTime.roundedDownToNearest(increment: Milliseconds): OffsetTime
fun Time.roundedDownToNearest(increment: Milliseconds): Time

Returns this time, rounded down to the nearest millisecond that satisfies the increment.

fun OffsetTime.roundedDownToNearest(increment: Minutes): OffsetTime
fun Time.roundedDownToNearest(increment: Minutes): Time

Returns this time, rounded down to the nearest minute that satisfies the increment.

fun OffsetTime.roundedDownToNearest(increment: Nanoseconds): OffsetTime
fun Time.roundedDownToNearest(increment: Nanoseconds): Time

Returns this time, rounded down to the nearest nanosecond that satisfies the increment.

fun OffsetTime.roundedDownToNearest(increment: Seconds): OffsetTime
fun Time.roundedDownToNearest(increment: Seconds): Time

Returns this time, rounded down to the nearest second that satisfies the increment.

roundedTo
Link copied to clipboard
common
fun DateTime.roundedTo(unit: TimeUnit): DateTime
fun OffsetDateTime.roundedTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.roundedTo(unit: TimeUnit): ZonedDateTime

Returns this date-time, rounded to match the precision of a given unit. If the time is halfway between whole values of the unit, it will be rounded up.

fun Instant.roundedTo(unit: TimeUnit): Instant

Returns this instant, rounded to match the precision of a given unit. If the time is halfway between whole values of the unit, it will be rounded up.

fun OffsetTime.roundedTo(unit: TimeUnit): OffsetTime
fun Time.roundedTo(unit: TimeUnit): Time

Returns this time, rounded to match the precision of a given unit. If the time is halfway between whole values of the unit, it will be rounded up.

roundedToNearest
Link copied to clipboard
common
fun DateTime.roundedToNearest(increment: Hours): DateTime
fun OffsetDateTime.roundedToNearest(increment: Hours): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: Hours): ZonedDateTime

Returns this date-time, rounded to the nearest hour that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun DateTime.roundedToNearest(increment: Microseconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: Microseconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: Microseconds): ZonedDateTime

Returns this date-time, rounded to the nearest microsecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun DateTime.roundedToNearest(increment: Milliseconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: Milliseconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: Milliseconds): ZonedDateTime

Returns this date-time, rounded to the nearest millisecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun DateTime.roundedToNearest(increment: Minutes): DateTime
fun OffsetDateTime.roundedToNearest(increment: Minutes): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: Minutes): ZonedDateTime

Returns this date-time, rounded to the nearest minute that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun DateTime.roundedToNearest(increment: Nanoseconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: Nanoseconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: Nanoseconds): ZonedDateTime

Returns this date-time, rounded to the nearest nanosecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun DateTime.roundedToNearest(increment: Seconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: Seconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: Seconds): ZonedDateTime

Returns this date-time, rounded to the nearest second that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun Instant.roundedToNearest(increment: Hours): Instant

Returns this instant, rounded to the nearest hour that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun Instant.roundedToNearest(increment: Microseconds): Instant

Returns this instant, rounded to the nearest microsecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun Instant.roundedToNearest(increment: Milliseconds): Instant

Returns this instant, rounded to the nearest millisecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun Instant.roundedToNearest(increment: Minutes): Instant

Returns this instant, rounded to the nearest minute that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun Instant.roundedToNearest(increment: Nanoseconds): Instant

Returns this instant, rounded to the nearest nanosecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun Instant.roundedToNearest(increment: Seconds): Instant

Returns this instant, rounded to the nearest second that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun OffsetTime.roundedToNearest(increment: Hours): OffsetTime
fun Time.roundedToNearest(increment: Hours): Time

Returns this time, rounded to the nearest hour that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun OffsetTime.roundedToNearest(increment: Microseconds): OffsetTime
fun Time.roundedToNearest(increment: Microseconds): Time

Returns this time, rounded to the nearest microsecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun OffsetTime.roundedToNearest(increment: Milliseconds): OffsetTime
fun Time.roundedToNearest(increment: Milliseconds): Time

Returns this time, rounded to the nearest millisecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun OffsetTime.roundedToNearest(increment: Minutes): OffsetTime
fun Time.roundedToNearest(increment: Minutes): Time

Returns this time, rounded to the nearest minute that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun OffsetTime.roundedToNearest(increment: Nanoseconds): OffsetTime
fun Time.roundedToNearest(increment: Nanoseconds): Time

Returns this time, rounded to the nearest nanosecond that satisfies the increment. If the time is halfway between increments, it will be rounded up.

fun OffsetTime.roundedToNearest(increment: Seconds): OffsetTime
fun Time.roundedToNearest(increment: Seconds): Time

Returns this time, rounded to the nearest second that satisfies the increment. If the time is halfway between increments, it will be rounded up.

roundedUpTo
Link copied to clipboard
common
fun DateTime.roundedUpTo(unit: TimeUnit): DateTime
fun OffsetDateTime.roundedUpTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.roundedUpTo(unit: TimeUnit): ZonedDateTime

Returns this date-time, rounded up to match the precision of a given unit.

fun Instant.roundedUpTo(unit: TimeUnit): Instant

Returns this instant, rounded up to match the precision of a given unit.

fun OffsetTime.roundedUpTo(unit: TimeUnit): OffsetTime
fun Time.roundedUpTo(unit: TimeUnit): Time

Returns this time, rounded up to match the precision of a given unit.

roundedUpToNearest
Link copied to clipboard
common
fun DateTime.roundedUpToNearest(increment: Hours): DateTime
fun OffsetDateTime.roundedUpToNearest(increment: Hours): OffsetDateTime
fun ZonedDateTime.roundedUpToNearest(increment: Hours): ZonedDateTime

Returns this date-time, rounded up to the nearest hour that satisfies the increment.

fun DateTime.roundedUpToNearest(increment: Microseconds): DateTime
fun OffsetDateTime.roundedUpToNearest(increment: Microseconds): OffsetDateTime
fun ZonedDateTime.roundedUpToNearest(increment: Microseconds): ZonedDateTime

Returns this date-time, rounded up to the nearest microsecond that satisfies the increment.

fun DateTime.roundedUpToNearest(increment: Milliseconds): DateTime
fun OffsetDateTime.roundedUpToNearest(increment: Milliseconds): OffsetDateTime
fun ZonedDateTime.roundedUpToNearest(increment: Milliseconds): ZonedDateTime

Returns this date-time, rounded up to the nearest millisecond that satisfies the increment.

fun DateTime.roundedUpToNearest(increment: Minutes): DateTime
fun OffsetDateTime.roundedUpToNearest(increment: Minutes): OffsetDateTime
fun ZonedDateTime.roundedUpToNearest(increment: Minutes): ZonedDateTime

Returns this date-time, rounded up to the nearest minute that satisfies the increment.

fun DateTime.roundedUpToNearest(increment: Nanoseconds): DateTime
fun OffsetDateTime.roundedUpToNearest(increment: Nanoseconds): OffsetDateTime
fun ZonedDateTime.roundedUpToNearest(increment: Nanoseconds): ZonedDateTime

Returns this date-time, rounded up to the nearest nanosecond that satisfies the increment.

fun DateTime.roundedUpToNearest(increment: Seconds): DateTime
fun OffsetDateTime.roundedUpToNearest(increment: Seconds): OffsetDateTime
fun ZonedDateTime.roundedUpToNearest(increment: Seconds): ZonedDateTime

Returns this date-time, rounded up to the nearest second that satisfies the increment.

fun Instant.roundedUpToNearest(increment: Hours): Instant

Returns this instant, rounded up to the nearest hour that satisfies the increment.

fun Instant.roundedUpToNearest(increment: Microseconds): Instant

Returns this instant, rounded up to the nearest microsecond that satisfies the increment.

fun Instant.roundedUpToNearest(increment: Milliseconds): Instant

Returns this instant, rounded up to the nearest millisecond that satisfies the increment.

fun Instant.roundedUpToNearest(increment: Minutes): Instant

Returns this instant, rounded up to the nearest minute that satisfies the increment.

fun Instant.roundedUpToNearest(increment: Nanoseconds): Instant

Returns this instant, rounded up to the nearest nanosecond that satisfies the increment.

fun Instant.roundedUpToNearest(increment: Seconds): Instant

Returns this instant, rounded up to the nearest second that satisfies the increment.

fun OffsetTime.roundedUpToNearest(increment: Hours): OffsetTime
fun Time.roundedUpToNearest(increment: Hours): Time

Returns this time, rounded up to the nearest hour that satisfies the increment.

fun OffsetTime.roundedUpToNearest(increment: Microseconds): OffsetTime
fun Time.roundedUpToNearest(increment: Microseconds): Time

Returns this time, rounded up to the nearest microsecond that satisfies the increment.

fun OffsetTime.roundedUpToNearest(increment: Milliseconds): OffsetTime
fun Time.roundedUpToNearest(increment: Milliseconds): Time

Returns this time, rounded up to the nearest millisecond that satisfies the increment.

fun OffsetTime.roundedUpToNearest(increment: Minutes): OffsetTime
fun Time.roundedUpToNearest(increment: Minutes): Time

Returns this time, rounded up to the nearest minute that satisfies the increment.

fun OffsetTime.roundedUpToNearest(increment: Nanoseconds): OffsetTime
fun Time.roundedUpToNearest(increment: Nanoseconds): Time

Returns this time, rounded up to the nearest nanosecond that satisfies the increment.

fun OffsetTime.roundedUpToNearest(increment: Seconds): OffsetTime
fun Time.roundedUpToNearest(increment: Seconds): Time

Returns this time, rounded up to the nearest second that satisfies the increment.

startOfDayAt
Link copied to clipboard
common
fun Date.startOfDayAt(zone: TimeZone): ZonedDateTime

The ZonedDateTime at the start of the day in zone, taking into account any daylight savings transitions.

startOfWeek
Link copied to clipboard
common
fun Date.startOfWeek(settings: WeekSettings): Date

The date at the start of the week that this date falls in. The first day of the week will be determined by settings.

fun Date.startOfWeek(locale: Locale): Date

The date at the start of the week that this date falls in. The first day of the week will be determined by locale.

fun DateTime.startOfWeek(settings: WeekSettings): DateTime

The date-time at the first instant of the week that this date-time falls in. The first day of the week will be determined by the system settings. This may differ from the first day of the week associated with the default locale on platforms that allow this to be customized.

fun DateTime.startOfWeek(locale: Locale): DateTime
fun OffsetDateTime.startOfWeek(locale: Locale): OffsetDateTime
fun ZonedDateTime.startOfWeek(locale: Locale): ZonedDateTime

The date-time at the first instant of the week that this date-time falls in. The first day of the week will be determined by locale.

fun OffsetDateTime.startOfWeek(settings: WeekSettings): OffsetDateTime
fun ZonedDateTime.startOfWeek(settings: WeekSettings): ZonedDateTime

The date-time at the first instant of the week that this date-time falls in. The first day of the week will be determined by the user's system settings. This may differ from the first day of the week associated with the default locale on platforms that allow the user to customize this.

TimeZone
Link copied to clipboard
common
fun TimeZone(id: String): TimeZone

Creates a TimeZone from an identifier.

toDate
Link copied to clipboard
common
fun String.toDate(): Date

Converts a string to a Date.

fun String.toDate(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): Date

Converts a string to a Date using a specific parser.

toDateAt
Link copied to clipboard
common
fun Instant.toDateAt(zone: TimeZone): Date

Converts this instant to the corresponding Date in zone.

fun Instant.toDateAt(offset: UtcOffset): Date

Converts this instant to the corresponding Date at offset.

toDateTime
Link copied to clipboard
common
fun String.toDateTime(): DateTime

Convert a string to a DateTime.

fun String.toDateTime(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): DateTime

Converts a string to a DateTime using a specific parser.

toDateTimeAt
Link copied to clipboard
common
fun Instant.toDateTimeAt(zone: TimeZone): DateTime

Converts this instant to the corresponding DateTime in zone.

fun Instant.toDateTimeAt(offset: UtcOffset): DateTime

Converts this instant to the corresponding DateTime at offset.

toDayOfWeek
Link copied to clipboard
common
fun Int.toDayOfWeek(): DayOfWeek

Converts an ISO day of week number to a DayOfWeek.

fun Int.toDayOfWeek(settings: WeekSettings): DayOfWeek

Converts a day of week number (1-7) to a DayOfWeek using the week definition provided by settings.

toInstant
Link copied to clipboard
common
fun OffsetDateTime.toInstant(): Instant
fun ZonedDateTime.toInstant(): Instant

Converts this date-time to an Instant representing the same time point.

fun String.toInstant(): Instant

Converts a string to an Instant.

fun String.toInstant(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): Instant

Converts a string to an Instant using a specific parser.

toInstantAt
Link copied to clipboard
common
fun DateTime.toInstantAt(offset: UtcOffset): Instant

Converts this date-time to the corresponding Instant at offset.

toMonth
Link copied to clipboard
common
fun Int.toMonth(): Month

Converts an ISO month number, from 1-12, to a Month.

toOffsetDateTime
Link copied to clipboard
common
fun ZonedDateTime.toOffsetDateTime(): OffsetDateTime

Returns the combined date, time, and UTC offset.

fun String.toOffsetDateTime(): OffsetDateTime

Converts a string to an OffsetDateTime.

fun String.toOffsetDateTime(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): OffsetDateTime

Converts a string to an OffsetDateTime using a specific parser.

toOffsetTime
Link copied to clipboard
common
fun OffsetDateTime.toOffsetTime(): OffsetTime
fun ZonedDateTime.toOffsetTime(): OffsetTime

Returns the combined time and UTC offset.

fun String.toOffsetTime(): OffsetTime

Converts a string to an OffsetTime.

fun String.toOffsetTime(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): OffsetTime

Converts a string to an OffsetTime using a specific parser.

toTime
Link copied to clipboard
common
fun String.toTime(): Time

Converts a string to a Time.

fun String.toTime(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): Time

Converts a string to a Time using a specific parser.

toUtcOffset
Link copied to clipboard
common
fun String.toUtcOffset(): UtcOffset

Converts a string to a UtcOffset.

fun String.toUtcOffset(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): UtcOffset

Converts a string to a UtcOffset using a specific parser.

toWeekDate
Link copied to clipboard
common
inline fun <T> Date.toWeekDate(action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to an ISO week date representation.

inline fun <T> Date.toWeekDate(settings: WeekSettings, action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to a week date representation using the week definition in settings.

inline fun <T> Date.toWeekDate(locale: Locale, action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to a week date representation using the week definition associated with the provided locale.

toYear
Link copied to clipboard
common
fun Date.toYear(): Year

Returns this date with the precision reduced to the year.

fun DateTime.toYear(): Year
fun OffsetDateTime.toYear(): Year
fun ZonedDateTime.toYear(): Year

Returns this date-time with the precision reduced to the year.

fun YearMonth.toYear(): Year

Returns this year-month with the precision reduced to the year.

fun String.toYear(): Year

Converts a string to a Year.

fun String.toYear(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): Year

Converts a string to a Year using a specific parser.

toYearMonth
Link copied to clipboard
common
fun Date.toYearMonth(): YearMonth

Returns this date with the precision reduced to the month.

fun DateTime.toYearMonth(): YearMonth
fun OffsetDateTime.toYearMonth(): YearMonth
fun ZonedDateTime.toYearMonth(): YearMonth

Returns this date-time with the precision reduced to the month.

fun String.toYearMonth(): YearMonth

Converts a string to a YearMonth.

fun String.toYearMonth(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): YearMonth

Converts a string to a YearMonth using a specific parser.

toZonedDateTime
Link copied to clipboard
common
fun String.toZonedDateTime(): ZonedDateTime

Converts a string to a ZonedDateTime.

fun OffsetDateTime.toZonedDateTime(zone: TimeZone, strategy: OffsetConversionStrategy): ZonedDateTime

Converts this OffsetDateTime to a ZonedDateTime using the specified strategy to adjust it to a valid date, time, and offset in zone.

fun String.toZonedDateTime(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): ZonedDateTime

Converts a string to a ZonedDateTime using a specific parser.

truncatedTo
Link copied to clipboard
common
fun DateTime.truncatedTo(unit: TimeUnit): DateTime
fun OffsetDateTime.truncatedTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.truncatedTo(unit: TimeUnit): ZonedDateTime

Returns this date-time, rounded down to match the precision of a given unit.

fun Instant.truncatedTo(unit: TimeUnit): Instant

Returns this instant, rounded down to match the precision of a given unit.

fun OffsetTime.truncatedTo(unit: TimeUnit): OffsetTime
fun Time.truncatedTo(unit: TimeUnit): Time

Returns this time, rounded down to match the precision of a given unit.

UtcOffset
Link copied to clipboard
common
fun UtcOffset(hours: Hours, minutes: Minutes = 0.minutes, seconds: Seconds = 0.seconds): UtcOffset

Creates a UTC offset of hours, minutes, and seconds. Each component must be within its valid range and without any mixed positive and negative values.

week
Link copied to clipboard
common
fun Date.week(settings: WeekSettings): DateRange

The range defining the week that this date falls within. The first day of the week will be determined by the provided settings.

fun Date.week(locale: Locale): DateRange

The range defining the week that this date falls within. The first day of the week will be the default associated with the provided locale.

fun DateTime.week(settings: WeekSettings): DateTimeInterval
fun OffsetDateTime.week(settings: WeekSettings): OffsetDateTimeInterval
fun ZonedDateTime.week(settings: WeekSettings): ZonedDateTimeInterval

The interval defining the week that this date-time falls within. The first day of the week will be determined by the provided settings.

fun DateTime.week(locale: Locale): DateTimeInterval
fun OffsetDateTime.week(locale: Locale): OffsetDateTimeInterval
fun ZonedDateTime.week(locale: Locale): ZonedDateTimeInterval

The interval defining the week that this date-time falls within. The first day of the week will be the default associated with the provided locale.

weekBasedYear
Link copied to clipboard
common
fun Date.weekBasedYear(settings: WeekSettings): Int
fun DateTime.weekBasedYear(settings: WeekSettings): Int
fun OffsetDateTime.weekBasedYear(settings: WeekSettings): Int
fun ZonedDateTime.weekBasedYear(settings: WeekSettings): Int

The week-based year, calculated using the week definition in settings. This value differs from the regular ISO year when the week number falls in the preceding or following year.

fun Date.weekBasedYear(locale: Locale): Int
fun DateTime.weekBasedYear(locale: Locale): Int
fun OffsetDateTime.weekBasedYear(locale: Locale): Int
fun ZonedDateTime.weekBasedYear(locale: Locale): Int

The week-based year, calculated using the week definition associated with the provided locale. This value differs from the regular ISO year when the week number falls in the preceding or following year.

weekOfMonth
Link copied to clipboard
common
fun Date.weekOfMonth(settings: WeekSettings): Int
fun DateTime.weekOfMonth(settings: WeekSettings): Int
fun OffsetDateTime.weekOfMonth(settings: WeekSettings): Int
fun ZonedDateTime.weekOfMonth(settings: WeekSettings): Int

The week of the month, from 0-6, calculated using the week definition in settings.

fun Date.weekOfMonth(locale: Locale): Int
fun DateTime.weekOfMonth(locale: Locale): Int
fun OffsetDateTime.weekOfMonth(locale: Locale): Int
fun ZonedDateTime.weekOfMonth(locale: Locale): Int

The week of the month, from 0-6, calculated using the default week definition associated with the provided locale.

weekOfWeekBasedYear
Link copied to clipboard
common
fun Date.weekOfWeekBasedYear(settings: WeekSettings): Int
fun DateTime.weekOfWeekBasedYear(settings: WeekSettings): Int
fun OffsetDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int
fun ZonedDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int

The week number of the week-based year, calculated using the week definition in settings.

fun Date.weekOfWeekBasedYear(locale: Locale): Int
fun DateTime.weekOfWeekBasedYear(locale: Locale): Int
fun OffsetDateTime.weekOfWeekBasedYear(locale: Locale): Int
fun ZonedDateTime.weekOfWeekBasedYear(locale: Locale): Int

The week number of the week-based year, calculated using the week definition associated with the provided locale.

weekOfYear
Link copied to clipboard
common
fun Date.weekOfYear(settings: WeekSettings): Int
fun DateTime.weekOfYear(settings: WeekSettings): Int
fun OffsetDateTime.weekOfYear(settings: WeekSettings): Int
fun ZonedDateTime.weekOfYear(settings: WeekSettings): Int

The week of the year, calculated using the week definition in settings. If the week number is associated with the preceding year, 0 will be returned.

fun Date.weekOfYear(locale: Locale): Int
fun DateTime.weekOfYear(locale: Locale): Int
fun OffsetDateTime.weekOfYear(locale: Locale): Int
fun ZonedDateTime.weekOfYear(locale: Locale): Int

The week of the year, calculated using the week definition associated with the provided locale. If the week number is associated with the preceding year, 0 will be returned.

ZonedDateTime
Link copied to clipboard
common
fun ZonedDateTime(dateTime: DateTime, zone: TimeZone): ZonedDateTime
fun ZonedDateTime(date: Date, time: Time, zone: TimeZone): ZonedDateTime
fun ZonedDateTime(year: Int, dayOfYear: Int, hour: Int, minute: Int, second: Int, nanosecond: Int, zone: TimeZone): ZonedDateTime
fun ZonedDateTime(year: Int, month: Month, day: Int, hour: Int, minute: Int, second: Int, nanosecond: Int, zone: TimeZone): ZonedDateTime
fun ZonedDateTime(year: Int, monthNumber: Int, day: Int, hour: Int, minute: Int, second: Int, nanosecond: Int, zone: TimeZone): ZonedDateTime

Creates a ZonedDateTime from a local date and time.

Properties

endOfDay
Link copied to clipboard
common
val Date.endOfDay: DateTime

The DateTime at the last representable instant of the day. Daylight savings transitions are not taken into account, so the returned date-time may not necessarily exist in all time zones.

endOfMonth
Link copied to clipboard
common
val Date.endOfMonth: Date

The date at the end of the month that this date falls in.

endOfMonth
Link copied to clipboard
common
val DateTime.endOfMonth: DateTime

The date-time at the last representable instant of the month that this date-time falls in.

endOfMonth
Link copied to clipboard
common
val OffsetDateTime.endOfMonth: OffsetDateTime

The date-time at the last representable instant of the month that this date-time falls in.

endOfMonth
Link copied to clipboard
common
val ZonedDateTime.endOfMonth: ZonedDateTime

The date-time at the last representable instant of the month that this date-time falls in.

endOfWeek
Link copied to clipboard
common
val Date.endOfWeek: Date

The date at the end of the ISO week that this date falls in.

endOfWeek
Link copied to clipboard
common
val DateTime.endOfWeek: DateTime

The date-time at the last representable instant of the ISO week that this date-time falls in.

endOfWeek
Link copied to clipboard
common
val OffsetDateTime.endOfWeek: OffsetDateTime

The date-time at the last representable instant of the ISO week that this date-time falls in.

endOfWeek
Link copied to clipboard
common
val ZonedDateTime.endOfWeek: ZonedDateTime

The date-time at the last representable instant of the ISO week that this date-time falls in.

endOfYear
Link copied to clipboard
common
val Date.endOfYear: Date

The date at the end of the year that this date falls in.

endOfYear
Link copied to clipboard
common
val DateTime.endOfYear: DateTime

The date-time at the last representable instant of the year that this date-time falls in.

endOfYear
Link copied to clipboard
common
val OffsetDateTime.endOfYear: OffsetDateTime

The date-time at the last representable instant of the year that this date-time falls in.

endOfYear
Link copied to clipboard
common
val ZonedDateTime.endOfYear: ZonedDateTime

The date-time at the last representable instant of the year that this date-time falls in.

isInLeapDay
Link copied to clipboard
common
val DateTime.isInLeapDay: Boolean

Checks if this date-time falls within February 29.

isInLeapDay
Link copied to clipboard
common
val OffsetDateTime.isInLeapDay: Boolean

Checks if this date-time falls within February 29.

isInLeapDay
Link copied to clipboard
common
val ZonedDateTime.isInLeapDay: Boolean

Checks if this date-time falls within February 29.

isInLeapYear
Link copied to clipboard
common
val Date.isInLeapYear: Boolean

Checks if this date falls within a leap year.

isInLeapYear
Link copied to clipboard
common
val DateTime.isInLeapYear: Boolean

Checks if this date-time falls within a leap year.

isInLeapYear
Link copied to clipboard
common
val OffsetDateTime.isInLeapYear: Boolean

Checks if this date-time falls within a leap year.

isInLeapYear
Link copied to clipboard
common
val ZonedDateTime.isInLeapYear: Boolean

Checks if this date-time falls within a leap year.

isLeapDay
Link copied to clipboard
common
val Date.isLeapDay: Boolean

Checks if this date is February 29.

lengthOfMonth
Link copied to clipboard
common
val Date.lengthOfMonth: Days

The length of this date's month in days.

lengthOfMonth
Link copied to clipboard
common
val DateTime.lengthOfMonth: Days

The length of this date-time's month in days.

lengthOfMonth
Link copied to clipboard
common
val OffsetDateTime.lengthOfMonth: Days

The length of this date-time's month in days.

lengthOfMonth
Link copied to clipboard
common
val ZonedDateTime.lengthOfMonth: Days

The length of this date-time's month in days.

lengthOfWeekBasedYear
Link copied to clipboard
common
val Date.lengthOfWeekBasedYear: Weeks

The length of the ISO week-based year that this date falls in, either 52 or 53 weeks.

lengthOfWeekBasedYear
Link copied to clipboard
common
val DateTime.lengthOfWeekBasedYear: Weeks

The length of the ISO week-based year that this date-time falls in, either 52 or 53 weeks.

lengthOfWeekBasedYear
Link copied to clipboard
common
val OffsetDateTime.lengthOfWeekBasedYear: Weeks

The length of the ISO week-based year that this date-time falls in, either 52 or 53 weeks.

lengthOfWeekBasedYear
Link copied to clipboard
common
val ZonedDateTime.lengthOfWeekBasedYear: Weeks

The length of the ISO week-based year that this date-time falls in, either 52 or 53 weeks.

lengthOfYear
Link copied to clipboard
common
val Date.lengthOfYear: Days

The length of this date's year in days.

lengthOfYear
Link copied to clipboard
common
val DateTime.lengthOfYear: Days

The length of this date-time's year in days.

lengthOfYear
Link copied to clipboard
common
val OffsetDateTime.lengthOfYear: Days

The length of this date-time's year in days.

lengthOfYear
Link copied to clipboard
common
val ZonedDateTime.lengthOfYear: Days

The length of this date-time's year in days.

startOfDay
Link copied to clipboard
common
val Date.startOfDay: DateTime

The DateTime at the start of the day. Daylight savings transitions are not taken into account, so the returned date-time may not necessarily exist in all time zones.

startOfMonth
Link copied to clipboard
common
val Date.startOfMonth: Date

The date at the start of the month that this date falls in.

startOfMonth
Link copied to clipboard
common
val DateTime.startOfMonth: DateTime

The date-time at the first instant of the month that this date-time falls in.

startOfMonth
Link copied to clipboard
common
val OffsetDateTime.startOfMonth: OffsetDateTime

The date-time at the first instant of the month that this date-time falls in.

startOfMonth
Link copied to clipboard
common
val ZonedDateTime.startOfMonth: ZonedDateTime

The date-time at the first instant of the month that this date-time falls in.

startOfWeek
Link copied to clipboard
common
val Date.startOfWeek: Date

The date at the start of the ISO week that this date falls in.

startOfWeek
Link copied to clipboard
common
val DateTime.startOfWeek: DateTime

The date-time at the first instant of the ISO week that this date-time falls in.

startOfWeek
Link copied to clipboard
common
val OffsetDateTime.startOfWeek: OffsetDateTime

The date-time at the first instant of the ISO week that this date-time falls in.

startOfWeek
Link copied to clipboard
common
val ZonedDateTime.startOfWeek: ZonedDateTime

The date-time at the first instant of the ISO week that this date-time falls in.

startOfYear
Link copied to clipboard
common
val Date.startOfYear: Date

The date at the start of the year that this date falls in.

startOfYear
Link copied to clipboard
common
val DateTime.startOfYear: DateTime

The date-time at the first instant of the year that this date-time falls in.

startOfYear
Link copied to clipboard
common
val OffsetDateTime.startOfYear: OffsetDateTime

The date-time at the first instant of the year that this date-time falls in.

startOfYear
Link copied to clipboard
common
val ZonedDateTime.startOfYear: ZonedDateTime

The date-time at the first instant of the year that this date-time falls in.

week
Link copied to clipboard
common
val Date.week: DateRange

The range defining the ISO week that this date falls within.

week
Link copied to clipboard
common
val DateTime.week: DateTimeInterval

The interval defining the ISO week that this date-time falls within.

week
Link copied to clipboard
common
val OffsetDateTime.week: OffsetDateTimeInterval

The interval defining the ISO week that this date-time falls within.

week
Link copied to clipboard
common
val ZonedDateTime.week: ZonedDateTimeInterval

The interval defining the ISO week that this date-time falls within.

weekBasedYear
Link copied to clipboard
common
val Date.weekBasedYear: Int

The week-based year used in the ISO week date system. This value differs from the regular ISO year when the week number falls in the preceding or following year.

weekBasedYear
Link copied to clipboard
common
val DateTime.weekBasedYear: Int

The week-based year used in the ISO week date system. This value differs from the regular ISO year when the week number falls in the preceding or following year.

weekBasedYear
Link copied to clipboard
common
val OffsetDateTime.weekBasedYear: Int

The week-based year used in the ISO week date system. This value differs from the regular ISO year when the week number falls in the preceding or following year.

weekBasedYear
Link copied to clipboard
common
val ZonedDateTime.weekBasedYear: Int

The week-based year used in the ISO week date system. This value differs from the regular ISO year when the week number falls in the preceding or following year.

weekOfMonth
Link copied to clipboard
common
val Date.weekOfMonth: Int

The week of the month, from 0-6, calculated using the ISO week definition.

weekOfMonth
Link copied to clipboard
common
val DateTime.weekOfMonth: Int

The week of the month, from 0-6, calculated using the ISO week definition.

weekOfMonth
Link copied to clipboard
common
val OffsetDateTime.weekOfMonth: Int

The week of the month, from 0-6, calculated using the ISO week definition.

weekOfMonth
Link copied to clipboard
common
val ZonedDateTime.weekOfMonth: Int

The week of the month, from 0-6, calculated using the ISO week definition.

weekOfWeekBasedYear
Link copied to clipboard
common
val Date.weekOfWeekBasedYear: Int

The week number used in the ISO week date system.

weekOfWeekBasedYear
Link copied to clipboard
common
val DateTime.weekOfWeekBasedYear: Int

The week number used in the ISO week date system.

weekOfWeekBasedYear
Link copied to clipboard
common
val OffsetDateTime.weekOfWeekBasedYear: Int

The week number used in the ISO week date system.

weekOfWeekBasedYear
Link copied to clipboard
common
val ZonedDateTime.weekOfWeekBasedYear: Int

The week number used in the ISO week date system.

weekOfYear
Link copied to clipboard
common
val Date.weekOfYear: Int

The week of the year, calculated using the ISO week definition. If the week number is associated with the preceding year, 0 will be returned.

weekOfYear
Link copied to clipboard
common
val DateTime.weekOfYear: Int

The week of the year, calculated using the ISO week definition. If the week number is associated with the preceding year, 0 will be returned.

weekOfYear
Link copied to clipboard
common
val OffsetDateTime.weekOfYear: Int

The week of the year, calculated using the ISO week definition. If the week number is associated with the preceding year, 0 will be returned.

weekOfYear
Link copied to clipboard
common
val ZonedDateTime.weekOfYear: Int

The week of the year, calculated using the ISO week definition. If the week number is associated with the preceding year, 0 will be returned.