| Printing a formatted date in Java |
| Sunday, 24 January 2010 | |
|
Printing a date out in the certain format is easy in java - you need to use the SimpleDateFormat class - there is an example below public void printFormattedDate() { Date theDate = new GregorianCalendar().getTime(); SimpleDateFormat format = new SimpleDateFormat( "EEE MMM dd HH:mm:ss zzz yyyy"); System.out.println("The date formatted is " + format.format(theDate)); } |
|
| Last Updated ( Friday, 11 June 2010 ) |