getYear
getYear: (LocalDate) -> numberThe year.
LocalDate.now()
LocalDate.of(…)
LocalDate.ofEpochDay(…)| Method | Returns | Description |
|---|---|---|
getYear() | number | The year. |
getMonthValue() | number | The month, 1 to 12. |
getDayOfMonth() | number | The day of the month. |
getDayOfYear() | number | The day of the year, 1 to 366. |
getDayOfWeek() | DayOfWeek | The day of the week. |
lengthOfMonth() | number | The days in this date's month. |
lengthOfYear() | number | 365 or 366. |
isLeapYear() | boolean | Whether the year is a leap year. |
toEpochDay() | number | Days since 1970-01-01. |
plusDays(number) | LocalDate | Plus daysToAdd days. |
plusWeeks(number) | LocalDate | Plus weeksToAdd weeks. |
plusMonths(number) | LocalDate | Plus monthsToAdd months; the day is clamped to the new month's length. |
plusYears(number) | LocalDate | Plus yearsToAdd years; 29 February becomes 28 in a common year. |
minusDays(number) | LocalDate | Less daysToSubtract days. |
minusWeeks(number) | LocalDate | Less weeksToSubtract weeks. |
minusMonths(number) | LocalDate | Less monthsToSubtract months. |
minusYears(number) | LocalDate | Less yearsToSubtract years. |
atStartOfDay() | LocalDateTime | Midnight at the start of this date. |
atTime(number, number) | LocalDateTime | (LocalDate, number, number) -> LocalDateTime: This date at hour:minute. |
atTime(LocalTime) | LocalDateTime | |
isAfter(LocalDate) | boolean | Whether this is after other. |
isBefore(LocalDate) | boolean | Whether this is before other. |
isEqual(LocalDate) | boolean | Whether this is other's date. |
compareTo(LocalDate) | number | The year, month and day differences in turn. |
format(DateTimeFormatter) | string | formatter's text for this date. |
equals(any) | boolean | Whether other is an equal LocalDate. |
hashCode() | number | The value's hash. |
toString() | string | yyyy-MM-dd. |
now() | LocalDate | () -> LocalDate: Today in the system zone. |
now(ZoneId) | LocalDate | |
of(number, number, number) | LocalDate | year-month-dayOfMonth. |
ofEpochDay(number) | LocalDate | The date epochDay days after 1970-01-01. |
| Method | Returns | Description |
|---|---|---|
LocalDateClass.now | LocalDate | () -> LocalDate: Today in the system zone. |
LocalDateClass.of | LocalDate | year-month-dayOfMonth. |
LocalDateClass.ofEpochDay | LocalDate | The date epochDay days after 1970-01-01. |
LocalDateTime.toLocalDate | LocalDate | The date. |
ZonedDateTime.toLocalDate | LocalDate | The local date there. |
getYeargetYear: (LocalDate) -> numberThe year.
getMonthValuegetMonthValue: (LocalDate) -> numberThe month, 1 to 12.
getDayOfMonthgetDayOfMonth: (LocalDate) -> numberThe day of the month.
getDayOfYeargetDayOfYear: (LocalDate) -> numberThe day of the year, 1 to 366.
getDayOfWeekgetDayOfWeek: (LocalDate) -> DayOfWeekThe day of the week.
lengthOfMonthlengthOfMonth: (LocalDate) -> numberThe days in this date's month.
lengthOfYearlengthOfYear: (LocalDate) -> number365 or 366.
isLeapYearisLeapYear: (LocalDate) -> booleanWhether the year is a leap year.
toEpochDaytoEpochDay: (LocalDate) -> numberDays since 1970-01-01.
plusDaysplusDays: (LocalDate, number) -> LocalDatePlus daysToAdd days.
plusWeeksplusWeeks: (LocalDate, number) -> LocalDatePlus weeksToAdd weeks.
plusMonthsplusMonths: (LocalDate, number) -> LocalDatePlus monthsToAdd months; the day is clamped to the new month's length.
plusYearsplusYears: (LocalDate, number) -> LocalDatePlus yearsToAdd years; 29 February becomes 28 in a common year.
minusDaysminusDays: (LocalDate, number) -> LocalDateLess daysToSubtract days.
minusWeeksminusWeeks: (LocalDate, number) -> LocalDateLess weeksToSubtract weeks.
minusMonthsminusMonths: (LocalDate, number) -> LocalDateLess monthsToSubtract months.
minusYearsminusYears: (LocalDate, number) -> LocalDateLess yearsToSubtract years.
atStartOfDayatStartOfDay: (LocalDate) -> LocalDateTimeMidnight at the start of this date.
atTimeatTime: ((LocalDate, number, number) -> LocalDateTime) & ((LocalDate, LocalTime) -> LocalDateTime)(LocalDate, number, number) -> LocalDateTime: This date at hour:minute.
(LocalDate, LocalTime) -> LocalDateTime: This date at time.
isAfterisAfter: (LocalDate, LocalDate) -> booleanWhether this is after other.
isBeforeisBefore: (LocalDate, LocalDate) -> booleanWhether this is before other.
isEqualisEqual: (LocalDate, LocalDate) -> booleanWhether this is other's date.
compareTocompareTo: (LocalDate, LocalDate) -> numberThe year, month and day differences in turn.
formatformat: (LocalDate, DateTimeFormatter) -> stringformatter's text for this date.
equalsequals: (LocalDate, any) -> booleanWhether other is an equal LocalDate.
hashCodehashCode: (LocalDate) -> numberThe value's hash.
toStringtoString: (LocalDate) -> stringyyyy-MM-dd.
nownow: (() -> LocalDate) & ((ZoneId) -> LocalDate)() -> LocalDate: Today in the system zone.
(ZoneId) -> LocalDate: Today in zone.
ofof: (number, number, number) -> LocalDateyear-month-dayOfMonth.
ofEpochDayofEpochDay: (number) -> LocalDateThe date epochDay days after 1970-01-01.