SimpleDateFormat will not work if he/she is starting with LocalDate, which is new in Java 8. From what I can see, you will have to use DateTimeFormatter.
LocalDate localDate = LocalDate.now(); // For reference
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd LLLL yyyy");
String formattedString = localDate.format(formatter);
That should print 05 May 1988. To get the period (AKA full stop) after the day and before the month, you might have to use "dd'.LLLL yyyy".
Answer from ProgrammersBlock on Stack OverflowOracle
docs.oracle.com › javase › 8 › docs › api › java › time › LocalDate.html
LocalDate (Java Platform SE 8 )
October 20, 2025 - Only objects of type LocalDate are compared, other types return false. To compare the dates of two TemporalAccessor instances, including dates in two different chronologies, use ChronoField.EPOCH_DAY as a comparator. ... A hash code for this date. ... Outputs this date as a String, such as 2007-12-03. The output will be in the ISO-8601 format uuuu-MM-dd. ... Java™ Platform Standard Ed.
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)); } }
Videos
02:27
Manipulating Dates in Java #12 - LocalDate formatting dates
05:26
#1. Learn About LocalDate of Java in 5 Minutes - YouTube
11:15
Java basics of the LocalDate, LocalTime, LocalDateTime, ZonedDateTime ...
04:31
Java Format Date Time LocalDateTime Tutorial
11:06
Java LocalDate - YouTube
18:01
Java Date Classes LocalDate LocalTime LocalDateTime - YouTube
TutorialsPoint
tutorialspoint.com › javatime › javatime_localdate_format.htm
java.time.LocalDate.format() Method Example
package com.tutorialspoint; import java.time.LocalDate; import java.time.format.DateTimeFormatter; public class LocalDateDemo { public static void main(String[] args) { LocalDate date = LocalDate.parse("2017-02-03"); System.out.println(date); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/YYYY"); System.out.println(formatter.format(date)); } }
How to do in Java
howtodoinjava.com › home › java date time › how to format localdate in java
How to Format LocalDate in Java - HowToDoInJava
March 3, 2024 - LocalDate today = LocalDate.now(); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); String formattedDate = today.format(dateTimeFormatter); //17-02-2022 · Happy Learning !! ... A fun-loving family man, passionate about computers and problem-solving, with over 15 years of experience in Java and related technologies.
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › format › DateTimeFormatter.html
DateTimeFormatter (Java Platform SE 8 )
October 20, 2025 - For example: LocalDate date = LocalDate.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd"); String text = date.format(formatter); LocalDate parsedDate = LocalDate.parse(text, formatter); All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters.
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
Top answer 1 of 8
493
SimpleDateFormat will not work if he/she is starting with LocalDate, which is new in Java 8. From what I can see, you will have to use DateTimeFormatter.
LocalDate localDate = LocalDate.now(); // For reference
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd LLLL yyyy");
String formattedString = localDate.format(formatter);
That should print 05 May 1988. To get the period (AKA full stop) after the day and before the month, you might have to use "dd'.LLLL yyyy".
2 of 8
118
It could be short as:
LocalDate.now().format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));
InfluxData
influxdata.com › home › java date format: a detailed guide
Java Date Format: A Detailed Guide | InfluxData
July 12, 2024 - They offer various methods of formatting and parsing dates without requiring explicit pattern definitions. Here’s an example: import java.time.LocalDate; import java.time.LocalTime; import java.time.LocalDateTime; public class Main { public static void main(String[] args) { // Creating a LocalDate object representing the current date LocalDate currentDate = LocalDate.now(); // Creating a LocalTime object representing the current time LocalTime currentTime = LocalTime.now(); // Creating a LocalDateTime object representing the current date and time LocalDateTime currentDateTime = LocalDateTime.now(); // Printing the current date, time, and date-time System.out.println("Current Date (LocalDate): " + currentDate); System.out.println("Current Time (LocalTime): " + currentTime); System.out.println("Current Date and Time (LocalDateTime): " + currentDateTime); } }
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
import java.time.LocalDateTime; // import the LocalDateTime class public class Main { public static void main(String[] args) { LocalDateTime myObj = LocalDateTime.now(); System.out.println(myObj); } } ... The "T" in the example above is used to separate the date from the time. You can use the DateTimeFormatter class with the ofPattern() method in the same package to format or parse date-time objects.
Lokalise
lokalise.com › home › java localdate localization tutorial: step by step examples
Java LocalDate localization tutorial: step by step examples
December 19, 2025 - But, our non-localized JavaLocalDateL10n app tried to parse it in the default ISO 8601 date format (YYYY-MM-DD); so obviously, no card order was placed in the system since no date was parsed that day! So, how can our poor JavaLocalDateL10n project overcome this? Well, Java developers have conveniently placed an overloaded LocalDate.parse() method in the LocalDate API just for this use case.
LabEx
labex.io › tutorials › java-java-localdate-format-method-117778
Java LocalDate Format Method: Mastering Date and Time Formatting | LabEx
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MMM/yyyy"); String formattedDate = formatter.format(currentDate); System.out.println("Current Date : " + currentDate); System.out.println("Formatted Date : " + formattedDate); Save the DateDemo.java file. To compile the program, run the following command in the terminal: ... In this lab, we learned how to use the Java LocalDate format method to format date and time in Java programming language.
Mkyong
mkyong.com › home › java8 › java 8 – how to convert string to localdate
Java 8 - How to convert String to LocalDate - Mkyong.com
February 4, 2020 - Here are a few Java examples of converting a String to the new Java 8 Date API – java.time.LocalDate · DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/MM/yyyy"); String date = "16/08/2016"; //convert String to LocalDate LocalDate localDate = LocalDate.parse(date, formatter); The key is understand the DateTimeFormatter patterns ·
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.base › java › time › format › DateTimeFormatter.html
DateTimeFormatter (Java SE 21 & JDK 21)
January 20, 2026 - For example: LocalDate date = LocalDate.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd"); String text = date.format(formatter); LocalDate parsedDate = LocalDate.parse(text, formatter); All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters.