Skip to content

Instantly share code, notes, and snippets.

@haizhe-cto
Created January 4, 2012 15:04
Show Gist options
  • Save haizhe-cto/1560425 to your computer and use it in GitHub Desktop.
Save haizhe-cto/1560425 to your computer and use it in GitHub Desktop.
DateFormat in java
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