core / io.islandtime

Package io.islandtime

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

Types

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

Date

A date in an ambiguous region.

class Date : Comparable<Date>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

DateTime

A date and time of day in an ambiguous region.

class DateTime : Comparable<DateTime>

DateTimeException

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) open class DateTimeException
(jvm) open class DateTimeException : Exception
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

DayOfWeek

A day of the week.

enum class DayOfWeek
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

Instant

An instant in time with nanosecond precision.

class Instant : TimePoint<Instant>, Comparable<Instant>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

IslandTime

Global configuration for Island Time.

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

Month

A month of the year.

enum class Month
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

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.

enum class OffsetConversionStrategy
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

OffsetDateTime

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

class OffsetDateTime : TimePoint<OffsetDateTime>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

OffsetTime

A time of day with an offset from UTC.

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

Time

A time of day in an ambiguous region.

class Time : Comparable<Time>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

TimeZone

A time zone.

sealed class TimeZone : Comparable<TimeZone>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

UtcOffset

The time shift between a local time and UTC.

class UtcOffset : Comparable<UtcOffset>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

Year

A year as defined by ISO-8601.

class Year : Comparable<Year>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

YearMonth

A month in a particular year.

class YearMonth : Comparable<YearMonth>
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

ZonedDateTime

A date and time of day in a particular region.

class ZonedDateTime : TimePoint<ZonedDateTime>

Extensions for External Classes

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

kotlin.Int

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

kotlin.String

Properties

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

endOfDay

The DateTime at the end of the day.

val Date.endOfDay: DateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

lengthOfWeekBasedYear

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

val Date.lengthOfWeekBasedYear: IntWeeks

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

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

startOfDay

The DateTime at the start of the day.

val Date.startOfDay: DateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

week

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

val Date.week: DateRange

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

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

weekBasedYear

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.

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

weekOfMonth

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

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

weekOfWeekBasedYear

The week number used in the ISO week date system.

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

weekOfYear

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.

val Date.weekOfYear: Int
val DateTime.weekOfYear: Int
val OffsetDateTime.weekOfYear: Int
val ZonedDateTime.weekOfYear: Int

Functions

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

asOffsetDateTime

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

asTimeZone

Converts this UtcOffset into a fixed-offset TimeZone.

fun UtcOffset.asTimeZone(): TimeZone
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

asUtcOffset

Converts a duration of hours into a UTC time offset of the same length.

fun IntHours.asUtcOffset(): UtcOffset

Converts a duration of minutes into a UTC time offset of the same length.

fun IntMinutes.asUtcOffset(): UtcOffset

Converts a duration of seconds into a UTC time offset of the same length.

fun IntSeconds.asUtcOffset(): UtcOffset
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

asZonedDateTime

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

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

at

Combines a Date with a Time to create a DateTime.

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

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

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

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

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

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

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

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

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

Combine a year and month to create a YearMonth.

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

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

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

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

infix fun DateTime.at(zone: TimeZone): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

atDay

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

fun YearMonth.atDay(day: Int): Date
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

atMonth

Combine a year and month number to create a YearMonth.

fun Year.atMonth(number: Int): YearMonth
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

atTime

Combines a Date with a time to create a DateTime.

fun Date.atTime(hour: Int, minute: Int, second: Int = 0, nanosecond: Int = 0): DateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

Date

Creates a Date from a year and day of year

fun Date(year: Int, dayOfYear: Int): Date
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

dateTimeAt

fun OffsetDateTime.dateTimeAt(zone: TimeZone): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

endOfDayAt

The ZonedDateTime at the last representable instant of this date in a particular time zone, taking into account any daylight savings transitions.

fun Date.endOfDayAt(zone: TimeZone): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

Instant

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

fun Instant(secondsSinceUnixEpoch: LongSeconds): Instant

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

fun Instant(secondsSinceUnixEpoch: LongSeconds, nanosecondAdjustment: IntNanoseconds): Instant
fun Instant(secondsSinceUnixEpoch: LongSeconds, nanosecondAdjustment: LongNanoseconds): Instant

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

fun Instant(millisecondsSinceUnixEpoch: LongMilliseconds): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

instantAt

fun OffsetDateTime.instantAt(zone: TimeZone): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

sameInstantAt

fun OffsetDateTime.sameInstantAt(zone: TimeZone): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

similarLocalTimeAt

fun OffsetDateTime.similarLocalTimeAt(zone: TimeZone): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

startOfDayAt

The ZonedDateTime at the start of this date in a particular time zone, taking into account any daylight savings transitions.

fun Date.startOfDayAt(zone: TimeZone): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

TimeZone

Creates a TimeZone from an identifier.

fun TimeZone(id: String): TimeZone
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

toDateAt

Converts this instant to the corresponding Date at offset.

fun Instant.toDateAt(offset: UtcOffset): Date

Converts this instant to the corresponding Date in zone.

fun Instant.toDateAt(zone: TimeZone): Date
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

toDateTimeAt

Converts this instant to the corresponding DateTime in zone.

fun Instant.toDateTimeAt(zone: TimeZone): DateTime

Converts this instant to the corresponding DateTime at offset.

fun Instant.toDateTimeAt(offset: UtcOffset): DateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

toInstant

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

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

toInstantAt

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

fun DateTime.toInstantAt(offset: UtcOffset): Instant
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

toOffsetDateTime

Returns the combined date, time, and UTC offset.

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

toOffsetTime

Returns the combined time and UTC offset.

fun OffsetDateTime.toOffsetTime(): OffsetTime
fun ZonedDateTime.toOffsetTime(): OffsetTime

toWeekDate

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

(jvm) fun <T> Date.toWeekDate(locale: Locale, action: (year: Int, week: Int, day: Int) -> T): T
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun <T> Date.toWeekDate(locale: <ERROR CLASS>, action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to an ISO week date representation.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun <T> Date.toWeekDate(action: (year: Int, week: Int, day: Int) -> T): T

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

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun <T> Date.toWeekDate(settings: WeekSettings, action: (year: Int, week: Int, day: Int) -> T): T
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

toYear

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

fun YearMonth.toYear(): Year

Returns this date with the precision reduced to the year.

fun Date.toYear(): Year

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

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

toYearMonth

Returns this date with the precision reduced to the month.

fun Date.toYearMonth(): YearMonth

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

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

toZonedDateTime

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

fun OffsetDateTime.toZonedDateTime(zone: TimeZone, strategy: OffsetConversionStrategy): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

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.

fun UtcOffset(hours: IntHours, minutes: IntMinutes = 0.minutes, seconds: IntSeconds = 0.seconds): UtcOffset

week

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.

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

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.

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

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

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

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

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.week(settings: WeekSettings): DateTimeInterval
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.week(settings: WeekSettings): OffsetDateTimeInterval
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.week(settings: WeekSettings): ZonedDateTimeInterval

weekBasedYear

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.

(jvm) fun Date.weekBasedYear(locale: Locale): Int
(jvm) fun DateTime.weekBasedYear(locale: Locale): Int
(jvm) fun OffsetDateTime.weekBasedYear(locale: Locale): Int
(jvm) fun ZonedDateTime.weekBasedYear(locale: Locale): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekBasedYear(locale: <ERROR CLASS>): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekBasedYear(locale: <ERROR CLASS>): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekBasedYear(locale: <ERROR CLASS>): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekBasedYear(locale: <ERROR CLASS>): 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.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekBasedYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekBasedYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekBasedYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekBasedYear(settings: WeekSettings): Int

weekOfMonth

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

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

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

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekOfMonth(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekOfMonth(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekOfMonth(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekOfMonth(settings: WeekSettings): Int

weekOfWeekBasedYear

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

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

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

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekOfWeekBasedYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekOfWeekBasedYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int

weekOfYear

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.

(jvm) fun Date.weekOfYear(locale: Locale): Int
(jvm) fun DateTime.weekOfYear(locale: Locale): Int
(jvm) fun OffsetDateTime.weekOfYear(locale: Locale): Int
(jvm) fun ZonedDateTime.weekOfYear(locale: Locale): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekOfYear(locale: <ERROR CLASS>): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekOfYear(locale: <ERROR CLASS>): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekOfYear(locale: <ERROR CLASS>): Int
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekOfYear(locale: <ERROR CLASS>): 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.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.weekOfYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun DateTime.weekOfYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun OffsetDateTime.weekOfYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun ZonedDateTime.weekOfYear(settings: WeekSettings): Int
(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86)

ZonedDateTime

Creates a ZonedDateTime from a local date and time.

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
fun ZonedDateTime(year: Int, dayOfYear: Int, hour: Int, minute: Int, second: Int, nanosecond: Int, zone: TimeZone): ZonedDateTime
fun ZonedDateTime(date: Date, time: Time, zone: TimeZone): ZonedDateTime
fun ZonedDateTime(dateTime: DateTime, zone: TimeZone): ZonedDateTime

Companion Object Functions

fromWeekDate

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

(jvm) fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int, locale: Locale): Date
(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int, locale: <ERROR CLASS>): Date

Create a Date from an ISO week date.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int): Date

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

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun Date.Companion.fromWeekDate(year: Int, week: Int, day: Int, settings: WeekSettings): Date