What's the difference between joda yyyy-MM-dd'T'HH:mm:ss.SSSZZ and ISO (wiki) date format?

7.3k Views Asked by At

The format string of Joda ISO date is:

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

the format string defined like in Wikipedia is:

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

Is there a difference or just a wrong documentation at Joda?

2

There are 2 best solutions below

0
On BEST ANSWER

From Joda documentation:

'Z' outputs offset without a colon, 'ZZ' outputs the offset with a colon

AFAIK in ISO 8601 format timezone designator colon is optional and both variants (+04:00 and +0400) are allowed

0
On

The Wikipedia format is incorrect. Joda's is correct. If you use the extended datetime format, timezone offset must be extended too. So, a single Z is simply wrong.

It must be either yyyy-MM-dd'T'HH:mm:ss.SSSZZ or yyyyMMdd'T'HHmmss.SSSZ.