Menu

#1 Invalid Abstime encoding when year < 1000

open
nobody
None
5
2010-02-05
2010-02-05
jdrevet
No

When we encode an Abstime using encodeVal() that represent a date with a year < 1000, the resulting year is represented by a string with less than 4 digits. This is not compliant with the xs:dateTime definition which specifies that the year must be represented by a 4 digit string.

For example :
We create an Abstime to represent the date "0206-04-04T16:20:50.000Z" : Abstime.parse("0206-04-04T16:20:50.000Z");
The encoding of this object (with the method encodeVal()) return "206-04-04T16:20:50.000Z" which is not compliant with xs:dateTime definition and cannot be decoded again to an Abstime.

I think that the encodeVal() method should add one or more '0' to complete a year with less than 4 digits (as it is done for months and days < 10).

Discussion


Log in to post a comment.

MongoDB Logo MongoDB