Karl Goblecoque
Karl Goblecoque

Reputation: 35

Cannot parse date

I'm trying to parse the date from a certificate to verify its validity and this error is shown:

Unparseable date: "Mon Dec 05 09:47:18 CST 2011"

The SimpleFormat I'm currently using is:

Date date = new SimpleDateFormat("EEE mmm dd HH:mm:ss z yyyy").parse(inputDate);

Upvotes: 2

Views: 690

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1500525

Try using MMM instead of mmm for the month name part. Also check which locale you're using, as obviously different locales have different month and day names.

Upvotes: 6

Related Questions