Friday, June 11, 2010

Formatting a Date Using a Custom Format

http://www.exampledepot.com/egs/java.text/FormatDate.html






Formatting a Date Using a Custom Format

A pattern of special characters is used to specify the format of the date. This example demonstrates some of the characters. For a complete listing, see the javadoc documentation for the SimpleDateFormat class.
Note: This example formats dates using the default locale (which, in the author's case, is Locale.ENGLISH). If the example is run in a different locale, the text (e.g., month names) will not be the same.


No comments: