Last active
March 9, 2023 11:10
-
-
Save adojos/9511d34805f97b537363b6106339b495 to your computer and use it in GitHub Desktop.
Java: Convert String to Date Using SimpleDateFormat #java
This file contains hidden or 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 convertToDate() throws ParseException { | |
String strDate = "2015-06-12"; | |
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); | |
Date date = dateFormatter.parse(strDate); | |
System.out.println(date); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment