LocalDate

@Serializable(with = LocalDateIso8601Serializer::class)
actual class LocalDate(year: Int, monthNumber: Int, dayOfMonth: Int) : Comparable<LocalDate> (source)
@Serializable(with = LocalDateIso8601Serializer::class)
expect class LocalDate(year: Int, monthNumber: Int, dayOfMonth: Int) : Comparable<LocalDate> (source)

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.

@Serializable(with = LocalDateIso8601Serializer::class)
actual class LocalDate(year: Int, monthNumber: Int, dayOfMonth: Int) : Comparable<LocalDate> (source)
@Serializable(with = LocalDateIso8601Serializer::class)
actual class LocalDate(val year: Int, val monthNumber: Int, val dayOfMonth: Int) : Comparable<LocalDate> (source)

Constructors

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

Constructs a LocalDate instance from the given date components.

expect constructor(year: Int, month: Month, dayOfMonth: Int)

Constructs a LocalDate instance from the given date components.

actual constructor(year: Int, monthNumber: Int, dayOfMonth: Int)
actual constructor(year: Int, monthNumber: Int, dayOfMonth: Int)
actual constructor(year: Int, month: Month, dayOfMonth: Int)

Types

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

A collection of predefined formats for parsing and formatting LocalDate values.

actual object Formats
actual object Formats

Properties

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

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

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

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

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

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

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

Returns the month (Month) component of the date.

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

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

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

Returns the year component of the date.

actual val year: Int
actual val year: Int

Functions

Link copied to clipboard
actual fun LocalDate.atStartOfDayIn(timeZone: TimeZone): Instant
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
Link copied to clipboard

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

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.

Link copied to clipboard
actual open operator override fun compareTo(other: LocalDate): Int
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
Link copied to clipboard
actual fun LocalDate.daysUntil(other: LocalDate): Int
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
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
Link copied to clipboard

Formats this value using the given format. Equivalent to calling DateTimeFormat.format on format with this.

hashCode
Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
open override fun hashCode(): 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.

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

Link copied to clipboard
actual fun LocalDate.monthsUntil(other: LocalDate): Int
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
Link copied to clipboard

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

Link copied to clipboard
actual operator fun LocalDate.plus(period: DatePeriod): LocalDate
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.

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 operator fun LocalDate.plus(period: DatePeriod): LocalDate
Link copied to clipboard
actual fun toEpochDays(): Int
expect fun toEpochDays(): Int

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

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

Converts the given LocalDate to NSDateComponents.

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

Converts this date to the extended ISO-8601 string representation.

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

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

Link copied to clipboard
actual fun LocalDate.yearsUntil(other: LocalDate): Int
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