Home

LocalDate

LocalDate is a date representation that stores year, month, and day without any time-of-day information or time zone. It is part of the ISO-8601 calendar system and is designed for date-only values. In Java, LocalDate is provided by the java.time package and is immutable and thread-safe.

Because it does not include time or zone data, LocalDate is suitable for birthdates, anniversaries, deadlines,

LocalDate offers accessors such as getYear(), getMonth(), getMonthValue(), and getDayOfMonth(). It also provides comparison methods like

For display and interoperability, LocalDate uses ISO-8601 string format (YYYY-MM-DD) in toString(), and can be converted

LocalDate has fixed bounds accessible via LocalDate.MIN and LocalDate.MAX, defining the practical supported range of dates.

or
scheduling
where
the
time
component
is
not
relevant.
It
can
be
created
from
a
calendar
date
or
parsed
from
a
string
in
ISO
format.
Common
constructors
include
LocalDate.of(year,
month,
dayOfMonth)
and
LocalDate.parse("YYYY-MM-DD").
The
current
date
can
be
obtained
with
LocalDate.now()
or
LocalDate.now(Clock)
for
a
specified
clock.
isBefore(),
isAfter(),
and
isEqual().
Arithmetic
operations
are
performed
with
methods
such
as
plusDays(),
minusDays(),
plusMonths(),
plusYears(),
minusWeeks(),
and
similar,
returning
new
LocalDate
instances
due
to
immutability.
to
other
date-time
representations,
for
example
atStartOfDay(ZoneId)
to
obtain
a
ZonedDateTime
or
Instant
for
conversion
to
Date.
See
also
LocalDateTime
and
ZonedDateTime
for
date-time
representations,
and
java.time.DateTimeFormatter
for
custom
parsing
and
formatting.