🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › LocalDate.html
LocalDate (Java Platform SE 8 )
October 20, 2025 - LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day. Other date fields, such as day-of-year, day-of-week and week-of-year, can also be accessed.
🌐
Java Code Geeks
examples.javacodegeeks.com › home › java development › core java
Java LocalDate Example - Java Code Geeks
July 23, 2021 - LocalDate class in Java 8 date time API represents a local date without time zone details. It is located in the java.time.LocalDate object. In this
Discussions

Should I use java.util.Date or switch to java.time.LocalDate? - Stack Overflow
Edit: Well, apparently it was too opinion based, so let me try to reword it more precisely - Are there any clear caveats or drawbacks of using LocalDate, LocalTime etc. in Java code that does not n... More on stackoverflow.com
🌐 stackoverflow.com
How to persist LocalDateTime values when using MongoDB with Spring
Or you know, don't use local datetimes for things like events which really only need Instants, or OffsetDateTimes A local datetime should only be converted to or from, but never persisted. More on reddit.com
🌐 r/java
13
0
July 6, 2019
[Java] Error:(22, 27) java: LocalDate(int,int,int) has private access in java.time.LocalDate
You are using the class incorrectly. It does not have a public constructor. http://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html http://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html http://www.journaldev.com/2800/java-8-date-time-api-example-tutorial-localdate-instant-localdatetime-parse-and-format More on reddit.com
🌐 r/learnprogramming
3
0
October 11, 2014
[Java] What is the difference between the classes Calendar, Date, and LocalDate?
The constructor for Date has been deprecated, and it's suggested that you use Calendar instead. Here's why: Prior to JDK 1.1, the class Date had two additional functions. It allowed the interpretation of dates as year, month, day, hour, minute, and second values. It also allowed the formatting and parsing of date strings. Unfortunately, the API for these functions was not amenable to internationalization. As of JDK 1.1, the Calendar class should be used to convert between dates and time fields and the DateFormat class should be used to format and parse date strings. The corresponding methods in Date are deprecated. LocalDate and Calendar differ because Calendar is used for "converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week.", whereas LocalDate from what I've seen is used to simplify development where timezones aren't required. More on reddit.com
🌐 r/learnprogramming
5
0
March 18, 2016
🌐
W3Schools
w3schools.com › php › php_date.asp
PHP Date and Time
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
🌐
Atlassian
docs.atlassian.com › software › jira › docs › api › 6.2.6 › com › atlassian › jira › datetime › LocalDate.html
LocalDate (Atlassian JIRA 6.2.6 API)
Represents a "Local Date" or "Calendar Date" - that is a date (no time) without any associated timezone. LocalDate is only defined to handle years in the Common Era - it cannot handle dates that are BC.
🌐
YouTube
youtube.com › watch
Java basics of the LocalDate, LocalTime, LocalDateTime, ZonedDateTime and the DateTimeFormatter - YouTube
In this video I will briefly dicuss how to create dates and times since Java 8.
Published   January 13, 2021
🌐
Mkyong
mkyong.com › home › java8 › java 8 – convert date to localdate and localdatetime
Java 8 - Convert Date to LocalDate and LocalDateTime - Mkyong.com
February 5, 2020 - Date date = new Date(); LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); // different way of create instant object LocalDate localDate = Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault())...
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-time-localdate-class-in-java
java.time.LocalDate Class in Java - GeeksforGeeks
July 23, 2025 - Java is used in all kind of application like as mobile application, desktop application, web application. In this Java java.time.LocalDate class is imported which represents to display the current date.
Find elsewhere
🌐
Medium
medium.com › @AlexanderObregon › javas-localdate-parse-method-explained-d2c2bb7322cb
Java’s LocalDate.parse() Method Explained | Medium
August 31, 2024 - When working with dates in Java, the java.time.LocalDate class provides a powerful and flexible way to handle date values without the time-of-day information. One of the most commonly used methods in this class is LocalDate.parse(), which allows ...
🌐
Dariawan
dariawan.com › tutorials › java › java-localdate-tutorial-examples
Java LocalDate Tutorial with Examples | Dariawan
August 21, 2019 - The LocalDate class represents a local date without time information. If you need both Date and Time information, you should use LocalDateTime instead. Liked this Tutorial? Share it on Social media!
🌐
GeeksforGeeks
geeksforgeeks.org › java › localdate-format-method-in-java
LocalDate format() method in Java - GeeksforGeeks
November 28, 2018 - // Program to illustrate the format() method import java.util.*; import java.time.*; import java.time.format.DateTimeFormatter; public class GfG { public static void main(String[] args) { // Parses the date LocalDate dt = LocalDate.parse("2018-11-01"); System.out.println(dt); // Function call DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/YYYY"); System.out.println(formatter.format(dt)); } }
🌐
Mkyong
mkyong.com › home › java8 › java 8 – convert localdate and localdatetime to date
Java 8 – Convert LocalDate and LocalDateTime to Date - Mkyong.com
February 7, 2020 - package com.mkyong.time; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Date; public class JavaDateExample { public static void main(String[] args) { // LocalDate -> Date LocalDate localDate = LocalDate.of(2020, 2, 20); Date date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); // LocalDateTime -> Date LocalDateTime localDateTime = LocalDateTime.of(2020,2,20,21,46,31); Date date2 = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); // ZonedDateTime -> Date ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault()); Date date3 = Date.from(zonedDateTime.toInstant()); } }
🌐
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 - LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day. Other date fields, such as day-of-year, day-of-week and week-of-year, can also be accessed.
🌐
YouTube
youtube.com › watch
#1. Learn About LocalDate of Java in 5 Minutes - YouTube
#1. Learn About LocalDate of Java in 5 MinutesLocalDate is a class introduced in Java 1.8 which represents a date. We will learn the below concepts in quick ...
Published   March 11, 2022
🌐
iO Flood
ioflood.com › blog › java-localdate
Java LocalDate: From Basics to Advanced Usage
February 29, 2024 - The LocalDate class in Java is used to represent a date in the ISO-8601 calendar system, which is the yyyy-MM-dd format, such as ‘2022-01-01’. It’s a part of the Java 8 Date and Time API and does not include time, time-zone, or offset ...
🌐
TutorialsPoint
tutorialspoint.com › javatime › javatime_localdate_now.htm
Java LocalDate Now
The java.time.LocalDate.now() method obtains the current date from the system clock in the default time-zone. Following is the declaration for java.time.LocalDate.now() method. public static LocalDate now() the current date using the system ...
Top answer
1 of 3
90

Despite the name, java.util.Date can be used to store both date and time (it stores UTC milliseconds offset since epoch)

I would definitely use the new API because of greater features:

  • Easier format/parsing. The API has its own format/parse methods
  • The API includes addition/subtraction operation (minusMinutes, plusDays, etc)

None of above are available on java.util.Date

Old Date can also be converted into LocalDateTime like this:

    Date oldDate = ...
    LocalDateTime newDateTime = 
      LocalDateTime.from(Instant.ofEpochMilli(oldDate.getTime()));
2 of 3
48

I’m adding to the correct Answer by Ole V.V.

JDBC 4.2

In particular - I am going to be working mainly with JDBC.

JDBC 4.2 added support for exchanging java.time objects with the database. See the PreparedStatement::setObject and ResultSet::getObject methods.

ZoneId z = ZoneId.of( "Africa/Tunis" ) ;
LocalDate today = LocalDate.now( z ) ;
myPreparedStatement.setObject( … , today ) ;

Retrieval.

LocalDate ld = myResultSet.getObject( … , LocalDate.class ) ;

For reasons that escape me, the JDBC spec does not require support for the two most commonly used classes: Instant and ZonedDateTime. Your database and JDBC driver may or may not add support for these.

If not, you can easily convert. Start with OffsetDateTime, with support required in JDBC.

OffsetDateTime odt = myResultSet.getObject( … , OffsetDateTime.class ) ;

To see this moment through the wall-clock time used by people of a particular region (a time zone), apply a ZoneId to get a ZonedDateTime object.

ZoneId z = ZoneId.of( "Asia/Kolkata" ) ;
ZonedDateTime zdt = odt.atZoneSameInstant() ;

To adjust into UTC, extract an Instant. An Instant is always in UTC, by definition.

Instant instant = odt.toInstant() ;

You can convert the other way, to write to a database.

myPreparedStatement.setObject( … , zdt.toOffsetDateTime() ;  // Converting from `ZonedDateTime` to `OffsetDateTime`. Same moment, same point on the timeline, different wall-clock time.

…and:

myPreparedStatement.setObject( … , instant.atOffset( ZoneOffset.UTC ) ) ;  // Converting from `Instant` to `OffsetDateTime`. Same moment, same point on the timeline, and even the same offset. `OffsetDateTime` is a more flexible class with abilities such as (a) applying various offsets and (b) flexible formatting when generating text, while `Instant` is meant to be a more basic building-block class. 

Notice the naming convention used in java.time: at, from, to, with, and so on.


About java.time

The java.time framework is built into Java 8 and later. These classes supplant the troublesome old legacy date-time classes such as java.util.Date, Calendar, & SimpleDateFormat.

To learn more, see the Oracle Tutorial. And search Stack Overflow for many examples and explanations. Specification is JSR 310.

The Joda-Time project, now in maintenance mode, advises migration to the java.time classes.

You may exchange java.time objects directly with your database. Use a JDBC driver compliant with JDBC 4.2 or later. No need for strings, no need for java.sql.* classes.

Where to obtain the java.time classes?

  • Java SE 8, Java SE 9, Java SE 10, Java SE 11, and later - Part of the standard Java API with a bundled implementation.
    • Java 9 adds some minor features and fixes.
  • Java SE 6 and Java SE 7
    • Most of the java.time functionality is back-ported to Java 6 & 7 in ThreeTen-Backport.
  • Android
    • Later versions of Android bundle implementations of the java.time classes.
    • For earlier Android (<26), the ThreeTenABP project adapts ThreeTen-Backport (mentioned above). See How to use ThreeTenABP….

The ThreeTen-Extra project extends java.time with additional classes. This project is a proving ground for possible future additions to java.time. You may find some useful classes here such as Interval, YearWeek, YearQuarter, and more.

🌐
Benchresources
benchresources.net › home › java › java 8 – localdate with method details and examples
Java 8 - LocalDate with method details and examples - BenchResources.Net
August 11, 2022 - Add 1 Year to current system LocalDate using plusYears() method · Read Java 8 – How to add Year, Month and Day fields to LocalDate ?
🌐
Medium
medium.com › @kotiavula6 › java-multithreading-mistakes-that-kill-performance-285c6b6480ca
Java Multithreading Mistakes That Kill Performance | by Kavya's Programming Path | Mar, 2026 | Medium
1 week ago - Java Multithreading Mistakes That Kill Performance The Mistakes That Only Show Up When It Is Too Late We had just released a new feature. Traffic picked up. Then our monitoring started showing …
🌐
Lokalise
lokalise.com › home › java localdate localization tutorial: step by step examples
Java LocalDate localization tutorial: step by step examples
December 19, 2025 - Parsing text in default and localized formats to LocalDate objects. Formatting Java LocalDate objects to text strings in localized date formats.
🌐
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
import java.time.LocalDate; // import the LocalDate class public class Main { public static void main(String[] args) { LocalDate myObj = LocalDate.now(); // Create a date object System.out.println(myObj); // Display the current date } }