LocalDate

Methods
30
Fields
None

Getting one

LocalDate.now()
LocalDate.of(…)
LocalDate.ofEpochDay(…)

Methods

MethodReturnsDescription
getYear()numberThe year.
getMonthValue()numberThe month, 1 to 12.
getDayOfMonth()numberThe day of the month.
getDayOfYear()numberThe day of the year, 1 to 366.
getDayOfWeek()DayOfWeekThe day of the week.
lengthOfMonth()numberThe days in this date's month.
lengthOfYear()number365 or 366.
isLeapYear()booleanWhether the year is a leap year.
toEpochDay()numberDays since 1970-01-01.
plusDays(number)LocalDatePlus daysToAdd days.
plusWeeks(number)LocalDatePlus weeksToAdd weeks.
plusMonths(number)LocalDatePlus monthsToAdd months; the day is clamped to the new month's length.
plusYears(number)LocalDatePlus yearsToAdd years; 29 February becomes 28 in a common year.
minusDays(number)LocalDateLess daysToSubtract days.
minusWeeks(number)LocalDateLess weeksToSubtract weeks.
minusMonths(number)LocalDateLess monthsToSubtract months.
minusYears(number)LocalDateLess yearsToSubtract years.
atStartOfDay()LocalDateTimeMidnight at the start of this date.
atTime(number, number)LocalDateTime(LocalDate, number, number) -> LocalDateTime: This date at hour:minute.
atTime(LocalTime)LocalDateTime
isAfter(LocalDate)booleanWhether this is after other.
isBefore(LocalDate)booleanWhether this is before other.
isEqual(LocalDate)booleanWhether this is other's date.
compareTo(LocalDate)numberThe year, month and day differences in turn.
format(DateTimeFormatter)stringformatter's text for this date.
equals(any)booleanWhether other is an equal LocalDate.
hashCode()numberThe value's hash.
toString()stringyyyy-MM-dd.
now()LocalDate() -> LocalDate: Today in the system zone.
now(ZoneId)LocalDate
of(number, number, number)LocalDateyear-month-dayOfMonth.
ofEpochDay(number)LocalDateThe date epochDay days after 1970-01-01.

Returned by

MethodReturnsDescription
LocalDateClass.nowLocalDate() -> LocalDate: Today in the system zone.
LocalDateClass.ofLocalDateyear-month-dayOfMonth.
LocalDateClass.ofEpochDayLocalDateThe date epochDay days after 1970-01-01.
LocalDateTime.toLocalDateLocalDateThe date.
ZonedDateTime.toLocalDateLocalDateThe local date there.

Method details

equals

equals: (LocalDate, any) -> boolean

Whether other is an equal LocalDate.

of

of: (number, number, number) -> LocalDate

year-month-dayOfMonth.