Created
January 4, 2012 15:04
-
-
Save haizhe-cto/1560425 to your computer and use it in GitHub Desktop.
DateFormat in 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
public static void main(String[] args) throws IOException, ParseException { | |
String strDate = "2011-01-12 07:50:00"; | |
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
Date date = formatter.parse(strDate); | |
System.out.println("Date="+date); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment