class LocalDate
source · line 9public class LocalDate public constructor(
/**
* The proleptic Gregorian year, including year zero.
*/
public val year: Int,
/**
* The one-based month number in 1..12.
*/
public val monthNumber: Int,
/**
* The one-based day within the validated month.
*/
public val dayOfMonth: Int) : Equals<LocalDate>, Compare<LocalDate>, Hash, ToString, Add<DatePeriod, LocalDate>, Sub<DatePeriod, LocalDate>
- Supertype
Equals<LocalDate> - Supertype
Compare<LocalDate> - Supertype
Hash - Supertype
ToString - Supertype
Add<DatePeriod, LocalDate> - Supertype
Sub<DatePeriod, LocalDate>
An immutable proleptic Gregorian date in years -999999999..999999999. Construction validates month/day combinations; it carries no time zone.
function plusDays
source · line 53public fun plusDays(value: Long): LocalDate
Shifts by a signed number of calendar days; unsupported results throw ArithmeticException.
parameter value
source · line 53value: Long
property monthNumber
source · line 17public val monthNumber: Int
get: public read-only
The one-based month number in 1..12.
property month
source · line 30public val month: Month
get: public read-only
The corresponding Gregorian Month value.
getter get
source · line 30get(): Month
function plusMonths
source · line 64public fun plusMonths(value: Long): LocalDate
Shifts by calendar months, clamping the day to the destination month's last valid day.
parameter value
source · line 64value: Long
function plusYears
source · line 72public fun plusYears(value: Long): LocalDate
Shifts by calendar years, clamping February 29 when needed.
parameter value
source · line 72value: Long
function compareTo
source · line 98public override operator fun compareTo(other: LocalDate): Long
- Overrides
compareTo
Orders values by their chronological or numeric value; only the result sign is significant.
parameter other
source · line 98other: LocalDate
constructor constructor
source · line 9constructor(public val year: Int, public val monthNumber: Int, public val dayOfMonth: Int)
parameter year
source · line 13public val year: Int
parameter dayOfMonth
source · line 21public val dayOfMonth: Int
parameter monthNumber
source · line 17public val monthNumber: Int
function equals
source · line 93public override operator fun equals(other: LocalDate): Boolean
- Overrides
equals
Compares the stored value components for equality.
parameter other
source · line 93other: LocalDate
property dayOfMonth
source · line 21public val dayOfMonth: Int
get: public read-only
The one-based day within the validated month.
function toEpochDays
source · line 49public fun toEpochDays(): Long
Returns signed days since 1970-01-01.
property dayOfWeek
source · line 42public val dayOfWeek: DayOfWeek
get: public read-only
The ISO weekday calculated from this date.
getter get
source · line 42get(): DayOfWeek
function minus
source · line 88public override operator fun minus(other: DatePeriod): LocalDate
- Overrides
minus
Subtracts combined years/months first, clamping the day, then subtracts period days.
parameter other
source · line 88other: DatePeriod
property year
source · line 13public val year: Int
get: public read-only
The proleptic Gregorian year, including year zero.
function daysUntil
source · line 79public fun daysUntil(other: LocalDate): Long
Returns other minus this in whole calendar days.
parameter other
source · line 79other: LocalDate
property yearMonth
source · line 34public val yearMonth: YearMonth
get: public read-only
The year/month portion of this date.
getter get
source · line 34get(): YearMonth
property dayOfYear
source · line 38public val dayOfYear: Int
get: public read-only
The one-based ordinal day in this year.
getter get
source · line 38get(): Int
function plus
source · line 83public override operator fun plus(other: DatePeriod): LocalDate
- Overrides
plus
Adds combined years/months first, clamping the day, then adds period days.
parameter other
source · line 83other: DatePeriod
constructor constructor
source · line 26constructor(year: Int, month: Month, dayOfMonth: Int)
parameter month
source · line 26month: Month
parameter year
source · line 26year: Int
parameter dayOfMonth
source · line 26dayOfMonth: Int
function hash
source · line 102public override fun hash(): Long
- Overrides
hash
Computes a hash consistent with component equality.
function toString
source · line 106public override fun toString(): String
- Overrides
toString
Formats this value as ISO calendar date.