wood burning stoves 2.0*
The moose likes Java in General and the fly likes How to Reformat a date string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to Reformat a date string" Watch "How to Reformat a date string" New topic
Author

How to Reformat a date string

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I have a date string in the format 'yyyy-mm-dd' which I need to present
in a dialog as 'ddMMM'. Does anyone know how to accomplish this?

Thanks.
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
Hi,

I assume you meant ddmm as the reformat? Is so, try the following:


HTH,
M


Java Regular Expressions
Greg T Robertson
Ranch Hand

Joined: Nov 18, 2003
Posts: 91
See the reference for Date Format and SimpleDateFormat

you will probably need to convert use DateFormat to get a timestamp first and then convert it to the text string you need using a differnt DateFormat object especially if you meant MMM (like May, Apr, Jun, etc)
[ October 22, 2004: Message edited by: Greg T Robertson ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Reformat a date string