[resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

One Star

[resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

So im trying to parse incoming dates that look like "2014-11-14T10:41:34-08:00" and have tried the following Date Patterns;

"yyyy-MM-dd'T'HH:mm:ss'zzz'"
"yyyy-MM-dd'T'HH:mm:ss'Z'"
"yyyy-MM-dd'T'HH:mm:ss'000Z'"
"yyyy-MM-dd'T'HH:mm:ssZ"
Anyone know what I should be using?
Cheers Andy

Accepted Solutions
Five Stars

Re: [resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

try below format. 
"yyyy-MM-dd'T'HH:mm:ssXXX"

hope this will work for you.

All Replies
Six Stars

Re: [resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

"yyyy-MM-dd'T'HH:mm:ssXXX"
Support for ISO8601 time zone with colon requires Java 7.
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Moderator

Re: [resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

Hi,
"2014-11-14T10:41:34-08:00"

"yyyy-MM-dd'T'HH:mm:ss'zzz'"
"yyyy-MM-dd'T'HH:mm:ss'Z'"
"yyyy-MM-dd'T'HH:mm:ss'000Z'"
"yyyy-MM-dd'T'HH:mm:ssZ"

Z stands for timezone -0800(RFC 822 time zone).
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: [resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

try below format. 
"yyyy-MM-dd'T'HH:mm:ssXXX"

hope this will work for you.
One Star

Re: [resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

try below format. 
"yyyy-MM-dd'T'HH:mm:ssXXX"

hope this will work for you.

This works thanks so much, now im wondering why it works Smiley Tongue
Six Stars

Re: [resolved] Unparseable date: "2014-11-14T10:41:34-08:00" ISO 8601 format?

Check the link I posted. the "Z" timezone format does not include the ":" in the TZ. The "X" was added to simpledate object in Java 7 to accommodate the ISO8601 TZ format with colon.