Lisa Anne
Lisa Anne

Reputation: 4595

Joda DateTimeFormatter Invalid format

I am getting the above error, but to me everything seems to be correct.

What I am doing wrong?

DateTimeFormatter simpleDateFormatInput= DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss Z");

DateTime datetime = simpleDateFormatInput.parseDateTime(pubDate);

Where pubDate is Sat, 30 Jan 2016 12:23:53 +0100

Upvotes: 0

Views: 172

Answers (1)

Reimeus
Reimeus

Reputation: 159754

The day and/or month from your input String may not match those from your default Locale. Try

DateTimeFormatter simpleDateFormatInput = 
   DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss Z").withLocale(Locale.US);

Upvotes: 1

Related Questions