The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001



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.


Date Conversion

Posted by Monte Gardner on June 21, 2001 at 2:32 PM

You can't do it with the Date class. You can't do much of
anything with the Date class. What you want to do is take the
source string, and create a Java.Util.GregorianCalendar out
of it. Then, use the Java.text.SimpleDateFormat class to
convert that GregorianCalendar object into a String in the
format that you want. I did a big project recently with
the time and Calendar classes, so If you want more help,
just send me an e-mail at

> Hi all,
> I�m working with Date class and I hava this problem, Is it possible translate a date from one format to another?, for example, I take a string in witch there is a date like MM/DD/YYYY and I would like to translate this date into DD/MM/YYYY. Can I do this with the Date class?, how can I do this?.

> Thanks a lot,



Sponsored Links

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