Combines this date with the time of midnight to create a ZonedDateTime at the start of this date.
Returns a zoned date-time from this date at the earliest valid time according to the rules in the time-zone.
Combines this date with the time of midnight to create a LocalDateTime at the start of this date.
Combines this date with a time to create a LocalDateTime.
Optional
hour: numberOptional
minute: numberCombines this date with a time to create a LocalDateTime.
Optional
hour: numberOptional
minute: numberOptional
second: numberCombines this date with a time to create a LocalDateTime.
Optional
hour: numberOptional
minute: numberOptional
second: numberOptional
nanoOfSecond: numberCombines this date with a time to create a LocalDateTime.
Optional
time: LocalTimeCombines this date with an offset time to create an OffsetDateTime.
Optional
time: OffsetTimeFormats this date using the specified formatter.
Gets the value of the specified field from this date as an int.
Gets the day-of-month field. The first day of the month is 1.
Gets the day-of-week field, which is an enum DayOfWeek.
Use the method getValue()
to extract the numeric value of the day
Remember that "Monday" has a getValue of 1, and "Sunday" a getValue of 7
Gets the day-of-year field. The minimum value of this is 1, and the max is 365 or 366 depending on if it is a leapyear
Gets the value of the specified field from this date as a long.
Gets the month-of-year field using the Month enum.
Gets the month-of-year field from 1 to 12.
Gets the year field.
Checks if the year is a leap year, according to the ISO proleptic calendar system rules.
Returns the length of the month represented by this date.
Returns the length of the year represented by this date.
Returns a copy of this date with the specified amount subtracted.
Returns a copy of this date with the specified amount subtracted.
Returns a copy of this LocalDate with the specified number of days subtracted.
Returns a copy of this LocalDate with the specified number of months subtracted.
Returns a copy of this LocalDate with the specified number of weeks subtracted.
Returns a copy of this LocalDate with the specified number of years subtracted.
Returns a copy of this date with the specified amount added.
Returns a copy of this date with the specified amount added.
Returns a copy of this LocalDate with the specified number of days added.
Returns a copy of this LocalDate with the specified number of months added.
Returns a copy of this LocalDate with the specified number of weeks added.
Returns a copy of this LocalDate with the specified number of years added.
Queries this date using the specified query.
Gets the range of valid values for the specified field.
Converts this LocalDate to the number of days since the epoch of 1970-01-01.
Calculates the period between this date and another date as a Period.
Calculates the amount of time until another date in terms of the specified unit.
Returns a copy of this date with the specified field set to a new value.
Returns a copy of this LocalDate with the day-of-month altered.
NOTE: this method does not accept negative numbers and will throw an exception if the day of month is invalid for the relevant month
the day-of-month to set in the result, from 1 to 28-31
Returns a copy of this LocalDate with the day-of-year altered.
the day-of-year to set in the result, from 1 to 365-366
Returns a copy of this LocalDate with the month-of-year altered.
the month-of-year to set in the result, from 1 (January) to 12 (December)
Returns a copy of this LocalDate with the year altered.
the year to set in the result, from MIN_YEAR to MAX_YEAR
Static
fromObtains an instance of LocalDate from a temporal object.
Static
nowObtains the current date from the system clock in the default time-zone.
Static
ofObtains an instance of LocalDate from a year, month and day.
Static
ofObtains an instance of LocalDate from the epoch day count.
Static
ofStatic
ofObtains an instance of LocalDate from a year and day-of-year.
Static
parseObtains an instance of LocalDate from a text string such as 2007-12-03.
Optional
formatter: DateTimeFormatter
A date without a time-zone in the ISO-8601 calendar system, such as 2007-12-03.
See java.time.LocalDate for full documentation