Created
March 23, 2013 07:28
-
-
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
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
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