LocalDate

expect class LocalDate(    year: Int,     monthNumber: Int,     dayOfMonth: Int) : Comparable<LocalDate>

The date part of LocalDateTime.

This class represents dates without a reference to a particular time zone. As such, these objects may denote different spans of time in different time zones: for someone in Berlin, 2020-08-30 started and ended at different moments from those for someone in Tokyo.

The arithmetic on LocalDate values is defined independently of the time zone (so 2020-08-30 plus one day is 2020-08-31 everywhere): see various LocalDate.plus and LocalDate.minus functions, as well as LocalDate.periodUntil and various other *until functions.

actual class LocalDate(    year: Int,     monthNumber: Int,     dayOfMonth: Int) : Comparable<LocalDate>
actual class LocalDate(    year: Int,     monthNumber: Int,     dayOfMonth: Int) : Comparable<LocalDate>
actual class LocalDate(    val year: Int,     val monthNumber: Int,     val dayOfMonth: Int) : Comparable<LocalDate>

Constructors

Link copied to clipboard
expect fun LocalDate(    year: Int,     monthNumber: Int,     dayOfMonth: Int)

Constructs a LocalDate instance from the given date components.

actual fun LocalDate(    year: Int,     monthNumber: Int,     dayOfMonth: Int)
actual fun LocalDate(    year: Int,     monthNumber: Int,     dayOfMonth: Int)
actual fun LocalDate(    year: Int,     monthNumber: Int,     dayOfMonth: Int)
Link copied to clipboard
expect fun LocalDate(    year: Int,     month: Month,     dayOfMonth: Int)

Constructs a LocalDate instance from the given date components.

actual fun LocalDate(    year: Int,     month: Month,     dayOfMonth: Int)
actual fun LocalDate(    year: Int,     month: Month,     dayOfMonth: Int)

Types

Link copied to clipboard
expect object Companion
actual object Companion
actual object Companion
actual object Companion

Functions

Link copied to clipboard
expect open operator override fun compareTo(other: LocalDate): Int

Compares this date with the other date. Returns zero if this date represent the same day as the other (i.e. equal to other), a negative number if this date is earlier than the other, and a positive number if this date is later than the other.

actual open operator override fun compareTo(other: LocalDate): Int
actual open operator override fun compareTo(other: LocalDate): Int
actual open operator override fun compareTo(other: LocalDate): Int
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
open override fun hashCode(): Int
Link copied to clipboard
expect fun toEpochDays(): Int

Returns the number of days since the epoch day 1970-01-01.

actual fun toEpochDays(): Int
actual fun toEpochDays(): Int
actual fun toEpochDays(): Int
Link copied to clipboard
expect open override fun toString(): String

Converts this date to the ISO-8601 string representation.

actual open override fun toString(): String
actual open override fun toString(): String
actual open override fun toString(): String

Properties

Link copied to clipboard
expect val dayOfMonth: Int

Returns the day-of-month component of the date.

actual val dayOfMonth: Int
actual val dayOfMonth: Int
actual val dayOfMonth: Int
Link copied to clipboard
expect val dayOfWeek: DayOfWeek

Returns the day-of-week component of the date.

actual val dayOfWeek: DayOfWeek
actual val dayOfWeek: DayOfWeek
actual val dayOfWeek: DayOfWeek
Link copied to clipboard
expect val dayOfYear: Int

Returns the day-of-year component of the date.

actual val dayOfYear: Int
actual val dayOfYear: Int
actual val dayOfYear: Int
Link copied to clipboard
expect val month: Month

Returns the month (Month) component of the date.

actual val month: Month
actual val month: Month
actual val month: Month
Link copied to clipboard
expect val monthNumber: Int

Returns the number-of-month (1..12) component of the date.

actual val monthNumber: Int
actual val monthNumber: Int
actual val monthNumber: Int
Link copied to clipboard
expect val year: Int

Returns the year component of the date.

actual val year: Int
actual val year: Int
actual val year: Int

Extensions

Link copied to clipboard
expect fun LocalDate.atStartOfDayIn(timeZone: TimeZone): Instant

Returns an instant that corresponds to the start of this date in the specified timeZone.

actual fun LocalDate.atStartOfDayIn(timeZone: TimeZone): Instant
actual fun LocalDate.atStartOfDayIn(timeZone: TimeZone): Instant
actual fun LocalDate.atStartOfDayIn(timeZone: TimeZone): Instant
Link copied to clipboard
fun LocalDate.atTime(    hour: Int,     minute: Int,     second: Int = 0,     nanosecond: Int = 0): LocalDateTime

Combines this date's components with the specified time components into a LocalDateTime value.

fun LocalDate.atTime(time: LocalTime): LocalDateTime

Combines this date's components with the specified LocalTime components into a LocalDateTime value.

Link copied to clipboard
expect fun LocalDate.daysUntil(other: LocalDate): Int

Returns the number of whole days between two dates.

actual fun LocalDate.daysUntil(other: LocalDate): Int
actual fun LocalDate.daysUntil(other: LocalDate): Int
actual fun LocalDate.daysUntil(other: LocalDate): Int
Link copied to clipboard
operator fun LocalDate.minus(period: DatePeriod): LocalDate

Returns a date that is the result of subtracting components of DatePeriod from this date. The components are subtracted in the order from the largest units to the smallest, i.e. from years to days.

operator fun LocalDate.minus(other: LocalDate): DatePeriod

Returns a DatePeriod representing the difference between other and this dates.

fun LocalDate.minus(unit: DateTimeUnit.DateBased): LocalDate

Returns a LocalDate that is the result of subtracting one unit from this date.

fun LocalDate.minus(value: Long, unit: DateTimeUnit.DateBased): LocalDate
expect fun LocalDate.minus(value: Int, unit: DateTimeUnit.DateBased): LocalDate

Returns a LocalDate that is the result of subtracting the value number of the specified unit from this date.

actual fun LocalDate.minus(value: Int, unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.minus(value: Int, unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.minus(value: Int, unit: DateTimeUnit.DateBased): LocalDate
Link copied to clipboard
expect fun LocalDate.monthsUntil(other: LocalDate): Int

Returns the number of whole months between two dates.

actual fun LocalDate.monthsUntil(other: LocalDate): Int
actual fun LocalDate.monthsUntil(other: LocalDate): Int
actual fun LocalDate.monthsUntil(other: LocalDate): Int
Link copied to clipboard
expect fun LocalDate.periodUntil(other: LocalDate): DatePeriod

Returns a DatePeriod representing the difference between this and other dates.

actual fun LocalDate.periodUntil(other: LocalDate): DatePeriod
actual fun LocalDate.periodUntil(other: LocalDate): DatePeriod
actual fun LocalDate.periodUntil(other: LocalDate): DatePeriod
Link copied to clipboard
expect operator fun LocalDate.plus(period: DatePeriod): LocalDate

Returns a date that is the result of adding components of DatePeriod to this date. The components are added in the order from the largest units to the smallest, i.e. from years to days.

expect fun LocalDate.plus(unit: DateTimeUnit.DateBased): LocalDate

Returns a LocalDate that is the result of adding one unit to this date.

expect fun LocalDate.plus(value: Int, unit: DateTimeUnit.DateBased): LocalDate
expect fun LocalDate.plus(value: Long, unit: DateTimeUnit.DateBased): LocalDate

Returns a LocalDate that is the result of adding the value number of the specified unit to this date.

actual operator fun LocalDate.plus(period: DatePeriod): LocalDate
actual fun LocalDate.plus(unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.plus(value: Int, unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.plus(value: Long, unit: DateTimeUnit.DateBased): LocalDate
actual operator fun LocalDate.plus(period: DatePeriod): LocalDate
actual fun LocalDate.plus(unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.plus(value: Int, unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.plus(value: Long, unit: DateTimeUnit.DateBased): LocalDate
actual operator fun LocalDate.plus(period: DatePeriod): LocalDate
actual fun LocalDate.plus(unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.plus(value: Int, unit: DateTimeUnit.DateBased): LocalDate
actual fun LocalDate.plus(value: Long, unit: DateTimeUnit.DateBased): LocalDate
Link copied to clipboard
fun LocalDate.toJavaLocalDate(): LocalDate

Converts this kotlinx.datetime.LocalDate value to a java.time.LocalDate value.

Link copied to clipboard
fun LocalDate.toNSDateComponents(): <Error class: unknown class>

Converts the given LocalDate to NSDateComponents.

Link copied to clipboard
expect fun LocalDate.until(other: LocalDate, unit: DateTimeUnit.DateBased): Int

Returns the whole number of the specified date units between this and other dates.

actual fun LocalDate.until(other: LocalDate, unit: DateTimeUnit.DateBased): Int
actual fun LocalDate.until(other: LocalDate, unit: DateTimeUnit.DateBased): Int
actual fun LocalDate.until(other: LocalDate, unit: DateTimeUnit.DateBased): Int
Link copied to clipboard
expect fun LocalDate.yearsUntil(other: LocalDate): Int

Returns the number of whole years between two dates.

actual fun LocalDate.yearsUntil(other: LocalDate): Int
actual fun LocalDate.yearsUntil(other: LocalDate): Int
actual fun LocalDate.yearsUntil(other: LocalDate): Int