|
String to formatted date -
04-22-2008, 12:02 PM
SimpleDateFormat df = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy");
SimpleDateFormat df1 = new SimpleDateFormat("dd MMM yyyy");
Date d1 =null;
String formattedDate=null;
try {
d1=df.parse("Tue Apr 22 21:03:48 IST 2008");
formattedDate =df1.format(d1);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(formattedDate);
|