Hi,
Simple java question. If my program takes in a date in the format,
yyyyMMdd, is there anyway I could output this date in java, in the
format, "November 13th 2005".
You probably can't get the 'th' part of the date using existing Java
techniques; I don't think there's any existing method you can use to get the
'th' in '13th' or the 'st' in '1st' or the 'nd' in '2nd'. But you could add
that part yourself with a simple if or switch statement that adds the
appropriate fragment once you've formatted the date as "November 13 2005" or
whatever. As Oliver Wong says in his reply, DateFormat is the approach you
should use. See also the SimpleDateFormat class for an explanation of Date
and Time Patterns.
If your application is going to have an international audience, you might
want to have a look at the Internationalization and Localization trail in
the Java Tutorial; most other countries don't display dates in the "November
13 2005" format.
Rhino