Skip to content

Instantly share code, notes, and snippets.

@ayushhgoyal
Created March 23, 2013 07:28
Show Gist options
  • Save ayushhgoyal/5226807 to your computer and use it in GitHub Desktop.
Save ayushhgoyal/5226807 to your computer and use it in GitHub Desktop.
Another date format example in java. For more formats check http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
SimpleDateFormat fromUser = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
SimpleDateFormat myFormat = new SimpleDateFormat("MMM d, ''yy");
try {
String reformattedStr = myFormat.format(fromUser
.parse("2013-09-12 09:09:09"));
CustomLog.logBlack(Thread.currentThread().getStackTrace(),
reformattedStr);
} catch (Exception e) {
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment