I want to convert the following string into Date type this way
Date dateToFormat = null;
DateFormat formatter = new SimpleDateFormat("E MMM d HH:mm:ss zzzz yyyy");
String databaseDateAsString = "Wed May 11 16:30:00 Asia/Calcutta 2011";
try {
dateToFormat = formatter.parse(databaseDateAsString);
} catch (Exception e) {
System.out.println("Cannot Parse Date:" + e);
}
But it is giving the following error:-
Cannot Parse Date:java.text.ParseException: Unparseable date:
"Wed May 11 16:30:00 Asia/Calcutta 2011"
Plz help how can I remove this error.