🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › LocalDate.html
LocalDate (Java Platform SE 8 )
October 20, 2025 - This returns a LocalDateTime formed from this date at the specified time. All possible combinations of date and time are valid. ... Combines this date with a time to create a LocalDateTime.
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.base › java › time › LocalDate.html
LocalDate (Java SE 21 & JDK 21)
January 20, 2026 - The minimum supported LocalDate, '-999999999-01-01'. All MethodsStatic MethodsInstance MethodsConcrete Methods ... Adjusts the specified temporal object to have the same date as this object. ... Combines this date with the time of midnight to create a LocalDateTime at the start of this date.
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-time-localdate-class-in-java
java.time.LocalDate Class in Java - GeeksforGeeks
July 23, 2025 - LocalDateTime localDate = LocalDateTime.now(); // DateTimeFormatter class used to format and // parse date and time. ofPattern() is a method // used with DateTimeFormatter to format and // parse date and time.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › LocalDateTime.html
LocalDateTime (Java Platform SE 8 )
October 20, 2025 - This returns a LocalDateTime with the specified year, month, day-of-month, hour, minute, second and nanosecond. The day must be valid for the year and month, otherwise an exception will be thrown. ... DateTimeException - if the value of any field is out of range, or if the day-of-month is invalid for the month-year · public static LocalDateTime of(LocalDate date, LocalTime time)
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-8-date-localdate-localdatetime-instant
Java 8 Date - LocalDate, LocalDateTime, Instant | DigitalOcean
August 3, 2022 - Default format of LocalDate=2014-04-28 28::Apr::2014 20140428 Default format of LocalDateTime=2014-04-28T16:25:49.341 28::Apr::2014 16::25::49 20140428 Default format of Instant=2014-04-28T23:25:49.342Z Default format after parsing = 2014-04-27T21:39:48 · Legacy Date/Time classes are used in almost all the applications, so having backward compatibility is a must. That’s why there are several utility methods through which we can convert Legacy classes to new classes and vice versa. package com.journaldev.java8.time; import java.time.Instant; import java.time.LocalDateTime; import java.time.Z
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › java.time.localdate
LocalDate Class (Java.Time) | Microsoft Learn
A date without a time-zone in the ISO-8601 calendar system, such as 2007-12-03. [Android.Runtime.Register("java/time/LocalDate", ApiSince=26, DoNotGenerateAcw=true)] public sealed class LocalDate : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable, Java.Time.Chrono.IChronoLocalDate
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-time-localdatetime-class-in-java
java.time.LocalDateTime Class in Java - GeeksforGeeks
July 23, 2025 - java.time.LocalDateTime class, introduced in Java 8, represents a local date-time object without timezone information. The LocalDateTime class in Java is an immutable date-time object that represents a date in the yyyy-MM-dd-HH-mm-ss.zzz format.
🌐
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
To display the current date and time, import the java.time.LocalDateTime class, and use its now() method:
🌐
Groovy
docs.groovy-lang.org › latest › html › groovy-jdk › java › time › LocalDate.html
LocalDate (Groovy JDK enhancements)
Returns a LocalDate one day before this date. ... Returns a Period equivalent to the time between this date (inclusive) and the provided LocalDate (exclusive).
Find elsewhere
🌐
Medium
medium.com › @rpoddar05 › why-java-time-localdate-and-localdatetime-are-better-than-java-util-date-f7a444c95d59
Why java.time.LocalDate and LocalDateTime Are Better Than java.util.Date | by RAHUL PODDAR | Medium
September 21, 2024 - While java.util.Date stores time down to milliseconds, it doesn’t distinguish between date and time. This lack of separation makes manipulating dates a challenge. With LocalDate and LocalTime, you get the flexibility to handle dates and times independently.
🌐
Javatpoint
javatpoint.com › java-localdate
Java LocalDate
Class class is an immutable class that represents time with a default format of hour-minute-second. It inherits Object class and implements the Comparable interface. class declaration Let's see the declaration of java.time.LocalTime class. public final class LocalTime extends Object implements Temporal, TemporalAdjuster, Comparable<LocalTime>, Serializable Methods of Class Method Description LocalDateTime...
🌐
Oracle
docs.oracle.com › en › java › javase › 19 › docs › api › java.base › java › time › LocalDate.html
LocalDate (Java SE 19 & JDK 19)
December 12, 2022 - The minimum supported LocalDate, '-999999999-01-01'. All MethodsStatic MethodsInstance MethodsConcrete Methods ... Adjusts the specified temporal object to have the same date as this object. ... Combines this date with the time of midnight to create a LocalDateTime at the start of this date.
Top answer
1 of 14
1002

Short answer

Date input = new Date();
LocalDate date = input.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();

Java 9 answer

In Java SE 9, a new method has been added that slightly simplifies this task:

Date input = new Date();
LocalDate date = LocalDate.ofInstant(input.toInstant(), ZoneId.systemDefault());

This new alternative is more direct, creating less garbage, and thus should perform better.

Explanation

Despite its name, java.util.Date represents an instant on the time-line, not a "date". The actual data stored within the object is a long count of milliseconds since 1970-01-01T00:00Z (midnight at the start of 1970 GMT/UTC).

The equivalent class to java.util.Date in JSR-310 is Instant, thus there is a convenient method toInstant() to provide the conversion:

Date input = new Date();
Instant instant = input.toInstant();

A java.util.Date instance has no concept of time-zone. This might seem strange if you call toString() on a java.util.Date, because the toString is relative to a time-zone. However that method actually uses Java's default time-zone on the fly to provide the string. The time-zone is not part of the actual state of java.util.Date.

An Instant also does not contain any information about the time-zone. Thus, to convert from an Instant to a local date it is necessary to specify a time-zone. This might be the default zone - ZoneId.systemDefault() - or it might be a time-zone that your application controls, such as a time-zone from user preferences. Use the atZone() method to apply the time-zone:

Date input = new Date();
Instant instant = input.toInstant();
ZonedDateTime zdt = instant.atZone(ZoneId.systemDefault());

A ZonedDateTime contains state consisting of the local date and time, time-zone and the offset from GMT/UTC. As such the date - LocalDate - can be easily extracted using toLocalDate():

Date input = new Date();
Instant instant = input.toInstant();
ZonedDateTime zdt = instant.atZone(ZoneId.systemDefault());
LocalDate date = zdt.toLocalDate();
2 of 14
194

Better way is:

Date date = ...;
Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDate()

Advantages of this version:

  • works regardless the input is an instance of java.util.Date or it's a subclass of java.sql.Date (unlike @JodaStephen's way). This is common with JDBC-originated data. java.sql.Date.toInstant() always throws an exception.

  • it's the same for JDK8 and JDK7 with JSR-310 backport

I personally use an utility class (but it is not backport-compatible):

/**
 * Utilities for conversion between the old and new JDK date types 
 * (between {@code java.util.Date} and {@code java.time.*}).
 * 
 * <p>
 * All methods are null-safe.
 */
public class DateConvertUtils {

    /**
     * Calls {@link #asLocalDate(Date, ZoneId)} with the system default time zone.
     */
    public static LocalDate asLocalDate(java.util.Date date) {
        return asLocalDate(date, ZoneId.systemDefault());
    }

    /**
     * Creates {@link LocalDate} from {@code java.util.Date} or it's subclasses. Null-safe.
     */
    public static LocalDate asLocalDate(java.util.Date date, ZoneId zone) {
        if (date == null)
            return null;

        if (date instanceof java.sql.Date)
            return ((java.sql.Date) date).toLocalDate();
        else
            return Instant.ofEpochMilli(date.getTime()).atZone(zone).toLocalDate();
    }

    /**
     * Calls {@link #asLocalDateTime(Date, ZoneId)} with the system default time zone.
     */
    public static LocalDateTime asLocalDateTime(java.util.Date date) {
        return asLocalDateTime(date, ZoneId.systemDefault());
    }

    /**
     * Creates {@link LocalDateTime} from {@code java.util.Date} or it's subclasses. Null-safe.
     */
    public static LocalDateTime asLocalDateTime(java.util.Date date, ZoneId zone) {
        if (date == null)
            return null;

        if (date instanceof java.sql.Timestamp)
            return ((java.sql.Timestamp) date).toLocalDateTime();
        else
            return Instant.ofEpochMilli(date.getTime()).atZone(zone).toLocalDateTime();
    }

    /**
     * Calls {@link #asUtilDate(Object, ZoneId)} with the system default time zone.
     */
    public static java.util.Date asUtilDate(Object date) {
        return asUtilDate(date, ZoneId.systemDefault());
    }

    /**
     * Creates a {@link java.util.Date} from various date objects. Is null-safe. Currently supports:<ul>
     * <li>{@link java.util.Date}
     * <li>{@link java.sql.Date}
     * <li>{@link java.sql.Timestamp}
     * <li>{@link java.time.LocalDate}
     * <li>{@link java.time.LocalDateTime}
     * <li>{@link java.time.ZonedDateTime}
     * <li>{@link java.time.Instant}
     * </ul>
     * 
     * @param zone Time zone, used only if the input object is LocalDate or LocalDateTime.
     * 
     * @return {@link java.util.Date} (exactly this class, not a subclass, such as java.sql.Date)
     */
    public static java.util.Date asUtilDate(Object date, ZoneId zone) {
        if (date == null)
            return null;

        if (date instanceof java.sql.Date || date instanceof java.sql.Timestamp)
            return new java.util.Date(((java.util.Date) date).getTime());
        if (date instanceof java.util.Date)
            return (java.util.Date) date;
        if (date instanceof LocalDate)
            return java.util.Date.from(((LocalDate) date).atStartOfDay(zone).toInstant());
        if (date instanceof LocalDateTime)
            return java.util.Date.from(((LocalDateTime) date).atZone(zone).toInstant());
        if (date instanceof ZonedDateTime)
            return java.util.Date.from(((ZonedDateTime) date).toInstant());
        if (date instanceof Instant)
            return java.util.Date.from((Instant) date);

        throw new UnsupportedOperationException("Don't know hot to convert " + date.getClass().getName() + " to java.util.Date");
    }

    /**
     * Creates an {@link Instant} from {@code java.util.Date} or it's subclasses. Null-safe.
     */
    public static Instant asInstant(Date date) {
        if (date == null)
            return null;
        else
            return Instant.ofEpochMilli(date.getTime());
    }

    /**
     * Calls {@link #asZonedDateTime(Date, ZoneId)} with the system default time zone.
     */
    public static ZonedDateTime asZonedDateTime(Date date) {
        return asZonedDateTime(date, ZoneId.systemDefault());
    }

    /**
     * Creates {@link ZonedDateTime} from {@code java.util.Date} or it's subclasses. Null-safe.
     */
    public static ZonedDateTime asZonedDateTime(Date date, ZoneId zone) {
        if (date == null)
            return null;
        else
            return asInstant(date).atZone(zone);
    }

}

The asLocalDate() method here is null-safe, uses toLocalDate(), if input is java.sql.Date (it may be overriden by the JDBC driver to avoid timezone problems or unnecessary calculations), otherwise uses the abovementioned method.

🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › time › LocalDate.html
LocalDate (Java SE 17 & JDK 17)
October 20, 2025 - The minimum supported LocalDate, '-999999999-01-01'. All MethodsStatic MethodsInstance MethodsConcrete Methods ... Adjusts the specified temporal object to have the same date as this object. ... Combines this date with the time of midnight to create a LocalDateTime at the start of this date.
🌐
Javatpoint
javatpoint.com › java-localdatetime
Java LocalDateTime
Class class is an immutable class that represents time with a default format of hour-minute-second. It inherits Object class and implements the Comparable interface. class declaration Let's see the declaration of java.time.LocalTime class. public final class LocalTime extends Object implements Temporal, TemporalAdjuster, Comparable&lt;LocalTime&gt;, Serializable Methods of Class Method Description LocalDateTime...
🌐
Baeldung
baeldung.com › home › java › java dates › convert date to localdate or localdatetime and back
Convert Date to LocalDate or LocalDateTime and Back | Baeldung
March 26, 2025 - We utilized methods such as toInstant(), ofEpochMilli(), and ofInstant(). Additionally, we also explored ways to convert java.sql.Date and java.sql.Timestamp into LocalDate and LocalDateTime respectively. The code backing this article is available on GitHub. Once you're logged in as a Baeldung Pro Member, start learning and coding on the project. ... Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:
🌐
Joda
joda.org › joda-time › apidocs › org › joda › time › LocalDate.html
LocalDate (Joda-Time 2.14.1 API)
Obtains a LocalDate set to the current system millisecond time using the specified chronology. ... Parses a LocalDate from the specified string. ... Parses a LocalDate from the specified string using a formatter. ... Constructs a LocalDate from a java.util.Calendar using exactly the same field ...
🌐
CodeGym
codegym.cc › java blog › core java › java localdate class
Java LocalDate class
May 15, 2023 - Let's start with a simple example ... } } In this example, we import the LocalDate class from the java.time package and create a new instance of LocalDate called today using the static now() method....
🌐
Baeldung
baeldung.com › home › java › java dates › introduction to the java date/time api
Introduction to the Java Date/Time API | Baeldung
October 13, 2023 - We mainly use these classes when time zones are not required to be explicitly specified in the context. As part of this section, we will cover the most commonly used APIs. The LocalDate represents a date in ISO format (yyyy-MM-dd) without time.