The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

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.

Message:

try this

Posted by babu reddy on June 26, 2001 at 10:26 AM

java.util.Date date1 = new java.util.Date();

java.text.DateFormat df1= java.text.DateFormat.getDateInstanceDateFormat.SHORT,java.util.Locale.US);

System.out.println("MM/DD/YYYY "+df1.format(date1));
String sdate = df1.format(date1);
java.util.Date date2 = df1.parse(sdate);
System.out.println("DATE OBJECT "+date2);
java.text.DateFormat df =java.text.DateFormat.getDateInstance(DateFormat.SHORT,java.util.Locale.UK);
System.out.println("/DD/MM/YYYY"+df.format(date2));



Replies:

Sponsored Links



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