Reputation: 94
I use the type xsd:dateTime for a long time und faced today a node of this type with this value
-292269055-12-02T17:47:04.192+01:00
, which I thought it was not a valid value, but when I use XML Spy 2017 to validate the value, it telle me, that it is valid.
Can someone explain me, why this value is valid or if it is a wrong implementation of XSD validation in XML Spy?
Thanks!
Dingjun
Upvotes: 0
Views: 645
Reputation: 32973
It looks strange, but it seems legal: quoting from https://www.w3.org/TR/xmlschema-2/#dateTime 3.2.7.1
The ·lexical space· of dateTime consists of finite-length sequences of characters of the form: '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?, where
So yes, a year can be negative and can be longer than 4 digits.
Upvotes: 1