Skip to content

Instantly share code, notes, and snippets.

@thomasstr
Created April 13, 2013 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasstr/5379050 to your computer and use it in GitHub Desktop.
Save thomasstr/5379050 to your computer and use it in GitHub Desktop.
SimpleDateFormat smf = new SimpleDateFormat("dd-MM-YY HH:mm:ss");
smf.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.println(smf.format(new Date()));
System.out.println(smf.format(new Date(1000*60*10)));
System.out.println(new java.util.Date(1364768456));
13-04-13 16:20:38
01-01-70 00:10:00
Fri Jan 16 20:06:08 CET 1970
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment