Skip to content

Instantly share code, notes, and snippets.

@sriki77
Created September 6, 2010 16:12
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 sriki77/567198 to your computer and use it in GitHub Desktop.
Save sriki77/567198 to your computer and use it in GitHub Desktop.
DateFormat indiaDtFmt = new SimpleDateFormat("dd/MM/yyyy HH'h'mm");
DateFormat gmtDtFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
indiaDtFmt.setTimeZone(TimeZone.getTimeZone("Asia/Calcutta"));
gmtDtFmt.setTimeZone(TimeZone.getTimeZone("GMT"));
Date worldWarIIDate = indiaDtFmt.parse("02/02/1944 06h30");
Date nonWorldWarIIDate = indiaDtFmt.parse("02/02/2006 06h30");
System.err.println(gmtDtFmt.format(worldWarIIDate) +" GMT");
System.err.println(gmtDtFmt.format(nonWorldWarIIDate) +" GMT");
1944-02-02 00:00:00 GMT
2006-02-02 01:00:00 GMT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment