Encodera

Thanks for reading!

Donate to the site — we work hard for you.

Java reference

LocalDate.now()

Returns today's date from the computer's clock and time zone.

Available since: Java 8

Syntax

static LocalDate now()

Return value

LocalDateA date without time, such as 2025-03-14.

Examples

Today, tomorrow and the current year. The output depends on the day you run it:

void main() {
    LocalDate today = LocalDate.now();
    IO.println(today);
    IO.println(today.plusDays(1));
    IO.println(today.getYear());
}

Output:

2026-10-04
2026-10-05
2026

The date in another time zone — it may already be tomorrow there:

void main() {
    IO.println(LocalDate.now(ZoneId.of("Pacific/Auckland")));
}

Output:

2026-10-04

Notes

LocalDate holds only the year, month and day — no time and no time zone. Objects are immutable: methods like plusDays() return a new date. The current time is LocalTime.now(), date and time together LocalDateTime.now(). In tests, pass a Clock to fix "today": LocalDate.now(clock).

See also

  • LocalDate.of() — Creates a date from a year, month and day.
  • LocalDateTime — A date and time without a time zone — for example, a meeting in a calendar.
  • ZonedDateTime — A date and time in a specific time zone — with daylight saving time taken into account.
  • Instant — An exact moment on the UTC timeline — for logs, timestamps and measurements.

Related recipes

In the tutorial

  • Dates and times — The java.time package — LocalDate, LocalTime, LocalDateTime, date arithmetic, Period, Duration, ChronoUnit, time zones and Instant.

Thanks for reading!

Donate to the site — we work hard for you.