I want to parse a String into a Date, but my SimpleDateFormat doesn't work. Everytime I get a ParseException. Whats wrong with my SimpleDateFormat? The datestring I want to parse looks like this:
Mon Dec 17 00:00:00 CET 2012
public Date toLongDate(String date) {
try {
return date != null ? new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy").parse(date) : null;
} catch (ParseException e) {
throw new RuntimeException("cannot parse date " + date);
}
}
best regards