core / io.islandtime.operators

Package io.islandtime.operators

A set of convenience operators for various date-time primitives, enabling things like date.next(TUESDAY), date.startOfWeek, or dateTime.truncatedTo(HOURS).

Properties

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

endOfMonth

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

val Date.endOfMonth: Date

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

val DateTime.endOfMonth: DateTime
val OffsetDateTime.endOfMonth: OffsetDateTime
val ZonedDateTime.endOfMonth: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

endOfWeek

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

val Date.endOfWeek: Date

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

val DateTime.endOfWeek: DateTime
val OffsetDateTime.endOfWeek: OffsetDateTime
val ZonedDateTime.endOfWeek: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

endOfYear

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

val Date.endOfYear: Date

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

val DateTime.endOfYear: DateTime
val OffsetDateTime.endOfYear: OffsetDateTime
val ZonedDateTime.endOfYear: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

startOfMonth

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

val Date.startOfMonth: Date

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

val DateTime.startOfMonth: DateTime
val OffsetDateTime.startOfMonth: OffsetDateTime
val ZonedDateTime.startOfMonth: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

startOfWeek

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

val Date.startOfWeek: Date

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

val DateTime.startOfWeek: DateTime
val OffsetDateTime.startOfWeek: OffsetDateTime
val ZonedDateTime.startOfWeek: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

startOfYear

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

val Date.startOfYear: Date

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

val DateTime.startOfYear: DateTime
val OffsetDateTime.startOfYear: OffsetDateTime
val ZonedDateTime.startOfYear: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

weekInterval

val DateTime.weekInterval: DateTimeInterval
val OffsetDateTime.weekInterval: OffsetDateTimeInterval
val ZonedDateTime.weekInterval: ZonedDateTimeInterval
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

weekRange

val Date.weekRange: DateRange

Functions

endOfWeek

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

(jvm) fun Date.endOfWeek(locale: Locale): Date
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.endOfWeek(locale: <ERROR CLASS>): Date

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.

(jvm) fun DateTime.endOfWeek(locale: Locale): DateTime
(jvm) fun OffsetDateTime.endOfWeek(locale: Locale): OffsetDateTime
(jvm) fun ZonedDateTime.endOfWeek(locale: Locale): ZonedDateTime
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.endOfWeek(locale: <ERROR CLASS>): DateTime
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.endOfWeek(locale: <ERROR CLASS>): OffsetDateTime
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.endOfWeek(locale: <ERROR CLASS>): ZonedDateTime

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.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.endOfWeek(settings: WeekSettings): Date

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.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) 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 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.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.endOfWeek(settings: WeekSettings): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.endOfWeek(settings: WeekSettings): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

next

The next date after this one that falls on a particular day of the week.

fun Date.next(dayOfWeek: DayOfWeek): Date

The next date-time after this one that falls on a particular day of the week.

fun DateTime.next(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.next(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.next(dayOfWeek: DayOfWeek): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

nextOrSame

The next date that falls on a particular day of the week, or this one if it falls on the same day.

fun Date.nextOrSame(dayOfWeek: DayOfWeek): Date

The next date-time that falls on a particular day of the week, or this one 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
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

previous

The last date before this one that falls on a particular day of the week.

fun Date.previous(dayOfWeek: DayOfWeek): Date

The last date-time before this one that falls on a particular day of the week.

fun DateTime.previous(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.previous(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.previous(dayOfWeek: DayOfWeek): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

previousOrSame

The last date that falls on a particular day of the week, or this one if it falls on the same day.

fun Date.previousOrSame(dayOfWeek: DayOfWeek): Date

The last date-time that falls on a particular day of the week, or this one 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
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

roundedDownTo

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

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

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

fun DateTime.roundedDownTo(unit: TimeUnit): DateTime
fun OffsetDateTime.roundedDownTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.roundedDownTo(unit: TimeUnit): ZonedDateTime

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

fun Instant.roundedDownTo(unit: TimeUnit): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

roundedDownToNearest

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fun Instant.roundedDownToNearest(increment: IntHours): Instant

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

fun Instant.roundedDownToNearest(increment: IntMinutes): Instant

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

fun Instant.roundedDownToNearest(increment: IntSeconds): Instant

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

fun Instant.roundedDownToNearest(increment: IntMilliseconds): Instant

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

fun Instant.roundedDownToNearest(increment: IntMicroseconds): Instant

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

fun Instant.roundedDownToNearest(increment: IntNanoseconds): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

roundedTo

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

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

Return 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 DateTime.roundedTo(unit: TimeUnit): DateTime
fun OffsetDateTime.roundedTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.roundedTo(unit: TimeUnit): ZonedDateTime

Return 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 Instant.roundedTo(unit: TimeUnit): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

roundedToNearest

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

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

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

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

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

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

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

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

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

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

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

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

Return 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: IntHours): DateTime
fun OffsetDateTime.roundedToNearest(increment: IntHours): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: IntHours): ZonedDateTime

Return 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: IntMinutes): DateTime
fun OffsetDateTime.roundedToNearest(increment: IntMinutes): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: IntMinutes): ZonedDateTime

Return 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 DateTime.roundedToNearest(increment: IntSeconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: IntSeconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: IntSeconds): ZonedDateTime

Return 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: IntMilliseconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: IntMilliseconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: IntMilliseconds): ZonedDateTime

Return 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: IntMicroseconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: IntMicroseconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: IntMicroseconds): ZonedDateTime

Return 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: IntNanoseconds): DateTime
fun OffsetDateTime.roundedToNearest(increment: IntNanoseconds): OffsetDateTime
fun ZonedDateTime.roundedToNearest(increment: IntNanoseconds): ZonedDateTime

Return 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: IntHours): Instant

Return 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: IntMinutes): Instant

Return this instant, 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: IntSeconds): Instant

Return 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: IntMilliseconds): Instant

Return 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: IntMicroseconds): Instant

Return 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: IntNanoseconds): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

roundedUpTo

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

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

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

fun DateTime.roundedUpTo(unit: TimeUnit): DateTime
fun OffsetDateTime.roundedUpTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.roundedUpTo(unit: TimeUnit): ZonedDateTime

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

fun Instant.roundedUpTo(unit: TimeUnit): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

roundedUpToNearest

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fun Instant.roundedUpToNearest(increment: IntHours): Instant

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

fun Instant.roundedUpToNearest(increment: IntMinutes): Instant

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

fun Instant.roundedUpToNearest(increment: IntSeconds): Instant

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

fun Instant.roundedUpToNearest(increment: IntMilliseconds): Instant

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

fun Instant.roundedUpToNearest(increment: IntMicroseconds): Instant

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

fun Instant.roundedUpToNearest(increment: IntNanoseconds): Instant

startOfWeek

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

(jvm) fun Date.startOfWeek(locale: Locale): Date
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.startOfWeek(locale: <ERROR CLASS>): Date

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.

(jvm) fun DateTime.startOfWeek(locale: Locale): DateTime
(jvm) fun OffsetDateTime.startOfWeek(locale: Locale): OffsetDateTime
(jvm) fun ZonedDateTime.startOfWeek(locale: Locale): ZonedDateTime
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.startOfWeek(locale: <ERROR CLASS>): DateTime
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.startOfWeek(locale: <ERROR CLASS>): OffsetDateTime
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.startOfWeek(locale: <ERROR CLASS>): ZonedDateTime

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

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.startOfWeek(settings: WeekSettings): Date

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.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) 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 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.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.startOfWeek(settings: WeekSettings): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.startOfWeek(settings: WeekSettings): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

truncatedTo

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

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

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

fun DateTime.truncatedTo(unit: TimeUnit): DateTime
fun OffsetDateTime.truncatedTo(unit: TimeUnit): OffsetDateTime
fun ZonedDateTime.truncatedTo(unit: TimeUnit): ZonedDateTime

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

fun Instant.truncatedTo(unit: TimeUnit): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

truncatedToHours

Return a copy of this time, truncated to the hour value. All smaller components will be replaced with zero.

fun Time.truncatedToHours(): Time
fun OffsetTime.truncatedToHours(): OffsetTime

Return a copy of this date-time, truncated to the hour value. All smaller components will be replaced with zero.

fun DateTime.truncatedToHours(): DateTime
fun ZonedDateTime.truncatedToHours(): ZonedDateTime
fun OffsetDateTime.truncatedToHours(): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

truncatedToMicroseconds

Return a copy of this time with the nanosecond value truncated to microseconds.

fun Time.truncatedToMicroseconds(): Time
fun OffsetTime.truncatedToMicroseconds(): OffsetTime

Return a copy of this date-time with the nanosecond value truncated to microseconds.

fun DateTime.truncatedToMicroseconds(): DateTime
fun ZonedDateTime.truncatedToMicroseconds(): ZonedDateTime
fun OffsetDateTime.truncatedToMicroseconds(): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

truncatedToMilliseconds

Return a copy of this time with the nanosecond value truncated to milliseconds.

fun Time.truncatedToMilliseconds(): Time
fun OffsetTime.truncatedToMilliseconds(): OffsetTime

Return a copy of this date-time with the nanosecond value truncated to milliseconds.

fun DateTime.truncatedToMilliseconds(): DateTime
fun ZonedDateTime.truncatedToMilliseconds(): ZonedDateTime
fun OffsetDateTime.truncatedToMilliseconds(): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

truncatedToMinutes

Return a copy of this time, truncated to the minute value. All smaller components will be replaced with zero.

fun Time.truncatedToMinutes(): Time

Return a copy of this date-time, truncated to the minute value. ll smaller components will be replaced with zero.

fun DateTime.truncatedToMinutes(): DateTime
fun OffsetDateTime.truncatedToMinutes(): OffsetDateTime

Return a copy of this date-time, truncated to the minute value. All smaller components will be replaced with zero.

fun ZonedDateTime.truncatedToMinutes(): ZonedDateTime

Return a copy of this time, truncated to the minute value. ll smaller components will be replaced with zero.

fun OffsetTime.truncatedToMinutes(): OffsetTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

truncatedToSeconds

Return a copy of this time, truncated to the second value. All smaller components will be replaced with zero.

fun Time.truncatedToSeconds(): Time
fun OffsetTime.truncatedToSeconds(): OffsetTime

Return a copy of this date-time, truncated to the second value. All smaller components will be replaced with zero.

fun DateTime.truncatedToSeconds(): DateTime
fun ZonedDateTime.truncatedToSeconds(): ZonedDateTime
fun OffsetDateTime.truncatedToSeconds(): OffsetDateTime

weekInterval

(jvm) fun DateTime.weekInterval(locale: Locale): DateTimeInterval
(jvm) fun OffsetDateTime.weekInterval(locale: Locale): OffsetDateTimeInterval
(jvm) fun ZonedDateTime.weekInterval(locale: Locale): ZonedDateTimeInterval
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekInterval(settings: WeekSettings): DateTimeInterval
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekInterval(locale: <ERROR CLASS>): DateTimeInterval
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekInterval(settings: WeekSettings): OffsetDateTimeInterval
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekInterval(locale: <ERROR CLASS>): OffsetDateTimeInterval
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekInterval(settings: WeekSettings): ZonedDateTimeInterval
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekInterval(locale: <ERROR CLASS>): ZonedDateTimeInterval

weekRange

(jvm) fun Date.weekRange(locale: Locale): DateRange
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekRange(settings: WeekSettings): DateRange
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekRange(locale: <ERROR CLASS>): DateRange