Date : Problem while parsing string to date
Hi All ,
I am trying to parse a string to a date object
publicstaticvoid main(String[] args)
{
try
{
DateFormat df =new SimpleDateFormat("dd-MMM-yyyy");
String tmpDate="27-Jul-2007";
Date date=df.parse(tmpDate);
System.out.println("Parsed date > "+ date);
}
catch(Exception e)
{
e.printStackTrace();
}
}
Following is the outcome :
Parsed date > Fri Jul 27 00:00:00 IST 2007
But for a fine reason , i want this parsed object in"dd-MMM-yyy"
format i.e. after parsing the string i want the date object to be in"dd-MMM-yyy"
format .
is there any way to parse a string to a perticular date format ?
thanks and regards
Mukul

