Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should ISO 8601 datetime for xCBL include dashes or not?

There seems to be a discrepancy between xCBL documentation and ISO 8601 standard for datetime format.

http://www.xcbl.org/xcbl30/SOX/structureref/xCBLref.htm#datetime

datetime: A combination Date and Time. Note the presence of a “T” character between the date and time portions, and the use of colons to separate hours, minutes, and seconds. These are as per ISO 8601. Format: YYYYMMDDTHH:MM:SS[[+-]HH:MM]? (the first MM is Months, the other two are minutes)

http://www.w3.org/TR/NOTE-datetime

The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601. Complete date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)

http://en.wikipedia.org/wiki/ISO_8601

Date and time expressed according to ISO 8601: Combined date and time in UTC: 2014-06-10T13:52:43+00:00

As you can see in the links above, the xCBL standard describes ISO8601 without dashes in the date, while both wikipedia and w3 describe it with dashes.

Does anyone have a final word on this? I'm developing an application for an API which has requested datetime in ISO 8601 format "as per xCBL standard" but running in to conflicts because of the various ways this is defined.

like image 273
Eaten by a Grue Avatar asked Jun 13 '14 16:06

Eaten by a Grue


1 Answers

I don't have access to the standard, but Wikipedia explicitly says that formats like YYYYMMDDTHH:MM:SS[[+-]HH:MM] are not valid ISO dates. I would be very glad if anyone having access to the standard could check it and either confirm it in a comment or fix my answer and the Wikipedia article.

Namely, the Wikipedia article says "A single point in time can be represented by concatenating a complete date expression, the letter T as a delimiter, and a valid time expression. /.../ Either basic or extended formats may be used, but both date and time must use the same format." (the bold formatting is by me). This would mean that e.g. 2014-12-05T09:53:48 and 20141205T095348 are valid, but 2014-12-05T095348 and 20141205T09:53:48 are not.

like image 76
Jaan Avatar answered Sep 23 '22 04:09

Jaan