I’m receiving an exception when parsing the following date:
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
Date parsedDate=null;
try {
parsedDate=sdf.parse("Thu Jan 26 15:05:48 COT 2012");
} catch (ParseException e) {
e.printStackTrace();
}
Is the pattern incorrect? What would be the correct form to parse the date string?+
The default SimpleDateFormat constructor doesn’t support all Locales.
You would have to specify the Locale: