Uses of Class
java.time.LocalDate
Package | Description |
---|---|
java.sql |
Provides the API for accessing and processing data stored in a
data source (usually a relational database) using the
Java™ programming language.
|
java.time |
The main API for dates, times, instants, and durations.
|
java.time.chrono |
Generic API for calendar systems other than the default ISO.
|
java.time.temporal |
Access to date and time using fields and units, and date time adjusters.
|
-
Uses of LocalDate in java.sql
Methods in java.sql that return LocalDate Modifier and Type Method Description LocalDate
Date. toLocalDate()
Creates aLocalDate
instance using the year, month and day from thisDate
object. -
Uses of LocalDate in java.time
Fields in java.time declared as LocalDate Modifier and Type Field Description static LocalDate
LocalDate. EPOCH
The epoch yearLocalDate
, '1970-01-01'.static LocalDate
LocalDate. MAX
The maximum supportedLocalDate
, '+999999999-12-31'.static LocalDate
LocalDate. MIN
The minimum supportedLocalDate
, '-999999999-01-01'.Methods in java.time that return LocalDate Modifier and Type Method Description LocalDate
Year. atDay(int dayOfYear)
Combines this year with a day-of-year to create aLocalDate
.LocalDate
YearMonth. atDay(int dayOfMonth)
Combines this year-month with a day-of-month to create aLocalDate
.LocalDate
YearMonth. atEndOfMonth()
Returns aLocalDate
at the end of the month.LocalDate
Year. atMonthDay(MonthDay monthDay)
Combines this year with a month-day to create aLocalDate
.LocalDate
MonthDay. atYear(int year)
Combines this month-day with a year to create aLocalDate
.static LocalDate
LocalDate. from(TemporalAccessor temporal)
Obtains an instance ofLocalDate
from a temporal object.LocalDate
LocalDate. minus(long amountToSubtract, TemporalUnit unit)
Returns a copy of this date with the specified amount subtracted.LocalDate
LocalDate. minus(TemporalAmount amountToSubtract)
Returns a copy of this date with the specified amount subtracted.LocalDate
LocalDate. minusDays(long daysToSubtract)
Returns a copy of thisLocalDate
with the specified number of days subtracted.LocalDate
LocalDate. minusMonths(long monthsToSubtract)
Returns a copy of thisLocalDate
with the specified number of months subtracted.LocalDate
LocalDate. minusWeeks(long weeksToSubtract)
Returns a copy of thisLocalDate
with the specified number of weeks subtracted.LocalDate
LocalDate. minusYears(long yearsToSubtract)
Returns a copy of thisLocalDate
with the specified number of years subtracted.static LocalDate
LocalDate. now()
Obtains the current date from the system clock in the default time-zone.static LocalDate
LocalDate. now(Clock clock)
Obtains the current date from the specified clock.static LocalDate
LocalDate. now(ZoneId zone)
Obtains the current date from the system clock in the specified time-zone.static LocalDate
LocalDate. of(int year, int month, int dayOfMonth)
Obtains an instance ofLocalDate
from a year, month and day.static LocalDate
LocalDate. of(int year, Month month, int dayOfMonth)
Obtains an instance ofLocalDate
from a year, month and day.static LocalDate
LocalDate. ofEpochDay(long epochDay)
Obtains an instance ofLocalDate
from the epoch day count.static LocalDate
LocalDate. ofInstant(Instant instant, ZoneId zone)
Obtains an instance ofLocalDate
from anInstant
and zone ID.static LocalDate
LocalDate. ofYearDay(int year, int dayOfYear)
Obtains an instance ofLocalDate
from a year and day-of-year.static LocalDate
LocalDate. parse(CharSequence text)
Obtains an instance ofLocalDate
from a text string such as2007-12-03
.static LocalDate
LocalDate. parse(CharSequence text, DateTimeFormatter formatter)
Obtains an instance ofLocalDate
from a text string using a specific formatter.LocalDate
LocalDate. plus(long amountToAdd, TemporalUnit unit)
Returns a copy of this date with the specified amount added.LocalDate
LocalDate. plus(TemporalAmount amountToAdd)
Returns a copy of this date with the specified amount added.LocalDate
LocalDate. plusDays(long daysToAdd)
Returns a copy of thisLocalDate
with the specified number of days added.LocalDate
LocalDate. plusMonths(long monthsToAdd)
Returns a copy of thisLocalDate
with the specified number of months added.LocalDate
LocalDate. plusWeeks(long weeksToAdd)
Returns a copy of thisLocalDate
with the specified number of weeks added.LocalDate
LocalDate. plusYears(long yearsToAdd)
Returns a copy of thisLocalDate
with the specified number of years added.LocalDate
LocalDateTime. toLocalDate()
Gets theLocalDate
part of this date-time.LocalDate
OffsetDateTime. toLocalDate()
Gets theLocalDate
part of this date-time.LocalDate
ZonedDateTime. toLocalDate()
Gets theLocalDate
part of this date-time.LocalDate
LocalDate. with(TemporalAdjuster adjuster)
Returns an adjusted copy of this date.LocalDate
LocalDate. with(TemporalField field, long newValue)
Returns a copy of this date with the specified field set to a new value.LocalDate
LocalDate. withDayOfMonth(int dayOfMonth)
Returns a copy of thisLocalDate
with the day-of-month altered.LocalDate
LocalDate. withDayOfYear(int dayOfYear)
Returns a copy of thisLocalDate
with the day-of-year altered.LocalDate
LocalDate. withMonth(int month)
Returns a copy of thisLocalDate
with the month-of-year altered.LocalDate
LocalDate. withYear(int year)
Returns a copy of thisLocalDate
with the year altered.Methods in java.time that return types with arguments of type LocalDate Modifier and Type Method Description Stream<LocalDate>
LocalDate. datesUntil(LocalDate endExclusive)
Returns a sequential ordered stream of dates.Stream<LocalDate>
LocalDate. datesUntil(LocalDate endExclusive, Period step)
Returns a sequential ordered stream of dates by given incremental step.Methods in java.time with parameters of type LocalDate Modifier and Type Method Description LocalDateTime
LocalTime. atDate(LocalDate date)
Combines this time with a date to create aLocalDateTime
.OffsetDateTime
OffsetTime. atDate(LocalDate date)
Combines this time with a date to create anOffsetDateTime
.static Period
Period. between(LocalDate startDateInclusive, LocalDate endDateExclusive)
Obtains aPeriod
consisting of the number of years, months, and days between two dates.Stream<LocalDate>
LocalDate. datesUntil(LocalDate endExclusive)
Returns a sequential ordered stream of dates.Stream<LocalDate>
LocalDate. datesUntil(LocalDate endExclusive, Period step)
Returns a sequential ordered stream of dates by given incremental step.static LocalDateTime
LocalDateTime. of(LocalDate date, LocalTime time)
Obtains an instance ofLocalDateTime
from a date and time.static OffsetDateTime
OffsetDateTime. of(LocalDate date, LocalTime time, ZoneOffset offset)
Obtains an instance ofOffsetDateTime
from a date, time and offset.static ZonedDateTime
ZonedDateTime. of(LocalDate date, LocalTime time, ZoneId zone)
Obtains an instance ofZonedDateTime
from a local date and time.long
LocalTime. toEpochSecond(LocalDate date, ZoneOffset offset)
Converts thisLocalTime
to the number of seconds since the epoch of 1970-01-01T00:00:00Z.long
OffsetTime. toEpochSecond(LocalDate date)
Converts thisOffsetTime
to the number of seconds since the epoch of 1970-01-01T00:00:00Z. -
Uses of LocalDate in java.time.chrono
Methods in java.time.chrono that return LocalDate Modifier and Type Method Description LocalDate
IsoChronology. date(int prolepticYear, int month, int dayOfMonth)
Obtains an ISO local date from the proleptic-year, month-of-year and day-of-month fields.LocalDate
IsoChronology. date(Era era, int yearOfEra, int month, int dayOfMonth)
Obtains an ISO local date from the era, year-of-era, month-of-year and day-of-month fields.LocalDate
IsoChronology. date(TemporalAccessor temporal)
Obtains an ISO local date from another date-time object.LocalDate
IsoChronology. dateEpochDay(long epochDay)
Obtains an ISO local date from the epoch-day.LocalDate
IsoChronology. dateNow()
Obtains the current ISO local date from the system clock in the default time-zone.LocalDate
IsoChronology. dateNow(Clock clock)
Obtains the current ISO local date from the specified clock.LocalDate
IsoChronology. dateNow(ZoneId zone)
Obtains the current ISO local date from the system clock in the specified time-zone.LocalDate
IsoChronology. dateYearDay(int prolepticYear, int dayOfYear)
Obtains an ISO local date from the proleptic-year and day-of-year fields.LocalDate
IsoChronology. dateYearDay(Era era, int yearOfEra, int dayOfYear)
Obtains an ISO local date from the era, year-of-era and day-of-year fields.LocalDate
IsoChronology. resolveDate(Map<TemporalField,Long> fieldValues, ResolverStyle resolverStyle)
Resolves parsedChronoField
values into a date during parsing. -
Uses of LocalDate in java.time.temporal
Methods in java.time.temporal that return types with arguments of type LocalDate Modifier and Type Method Description static TemporalQuery<LocalDate>
TemporalQueries. localDate()
A query forLocalDate
returning null if not found.Method parameters in java.time.temporal with type arguments of type LocalDate Modifier and Type Method Description static TemporalAdjuster
TemporalAdjusters. ofDateAdjuster(UnaryOperator<LocalDate> dateBasedAdjuster)
Obtains aTemporalAdjuster
that wraps a date adjuster.