The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


more date formatting

Posted by griff on September 11, 2000 at 11:01 AM

I have a incoming date string i.e

10/04/2000 (dd/mm/yyy)

I want to format this using the following code:

simpleDateFormat formatter = SimpleDateFormat(dd MMM YYYY);
theDate = new java.util.Date("10/04/2000");
output = formatter.format(theDate);

This returns : 4 October 2000 ie mm/dd/yyyy
and not 10 April 2000 ie dd/mm/yyyy as expected

can I change the date object created to the correct format.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us