oferei / json-gate

A friendly, fast JSON schema validator
MIT License
100 stars 16 forks source link

'date-time' format does not support non-UTC time zones #37

Closed O11o1 closed 7 years ago

O11o1 commented 8 years ago

As per https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC , time values of the format

"2016-10-18T11:11:11.616+05"

where +05 is represented as the time zone offset from UTC, causes the string to be read as invalid. In contrast

"2016-10-18T11:11:11.616Z"

is considered valid (as expected).

oferei commented 8 years ago

Hmm, you're right. I read this part of the documentation:

date-time This SHOULD be a date in ISO 8601 format of YYYY-MM- DDThh:mm:ssZ in UTC time. This is the recommended form of date/ timestamp.

and figured it must end with a Z. But I guess adding the offsets should be easy.

oferei commented 7 years ago

fixed.

O11o1 commented 7 years ago

Thank you!