Last active
March 9, 2023 11:01
-
-
Save adojos/dad430fbf471a3357dc0f4be9a99dfdd to your computer and use it in GitHub Desktop.
Java: Convert String to Date Using DateTimeFormatter #java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void convertToLocalDateWithDateFormatter() { | |
String strDate = "06/12/2015"; | |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); | |
LocalDate date = LocalDate.parse(strDate,formatter); | |
System.out.println(date); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment