Unparseable date exception, can't find pattern for 2014-11-28T13:46:23-08:00

124 Views Asked by At

I'm trying to parse 2014-11-28T13:46:23-08:00 to a java.util.Date

For the simpledateformat so far I've tried:

yyyy-MM-dd'T'HH:mm:ss
yyyy-MM-dd HH:mm:ss

yyyy-MM-dd works but I need at-least precision to the minute.

What pattern should I be using to parse this date?

1

There are 1 best solutions below

1
On BEST ANSWER

This looks like the standard ISO-8601 date format. Try:

yyyy-MM-dd'T'HH:mm:ssZ

This is very close to the first format you tried, with the addition of "Z". That character is for the UTC offset.