GregorianCalendar
Can anyone help pls?
below code displays this " Sat May 12 00:00:00 BST 2007 " , but i want display in this format dd/MM/yyyy.
Thank you.
import java.util.*;
import java.text.*;
publicclass GregorianCaDemo
{
private Date testDate;
private GregorianCalendar toTest;
private SimpleDateFormat df;
public GregorianCaDemo()
{
toTest =new GregorianCalendar();
df =new SimpleDateFormat("dd/MM/yyyy");
testDate =null;
}
publicvoid test()
{
String date = df.format( toTest.getTime());
try{
testDate = df.parse( date);
}catch ( ParseException e){
System.out.println("Something wrong here");
System.exit( 0);
}// end try- catch
System.out.print(testDate);
}
}

