A parser for email messages contains the following data format definition:
private final static DateFormat dateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
if (line.startsWith("Date:")) {
try {
email.date = dateFormat.parse(line.substring(6));
} catch (ParseException e) {
System.err.println("Unparsable: " + line.substring(6));
}
This code prints the error:
Unparsable: Mon, 15 Jan 2001 23:18:00 -0800 (PST)
Why do the formats not match?
EEE, d MMM yyyy HH:mm:ss Z