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.


YYYYMMDDTHH:MM:SS[[+-]HH:MM] is valid under ISO 8601.

Representations can be done in one of two formats – a basic format with a minimal number of separators or an extended format with separators added to enhance human readability. The standard notes that "The basic format should be avoided in plain text." The separator used between date values (year, month, week, and day) is the hyphen, while the colon is used as the separator between time values (hours, minutes, and seconds)..

The examples show both cases: eg "YYYY-MM-DD or YYYYMMDD" and "hh:mm:ss or hhmmss":

ISO 8601 covers several valid formats (including the omission of components); most implementations use a restriction for simplicity/uniformity - the note of "as per xCBL" imposes such a restriction to a specific format.


I don't have access to the standard, but Wikipedia explicitly says that formats like YYYYMMDDTHH:MM:SS[[+-]HH:MM] are not a 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 eg 2014-12-05T09:53:48 and 20141205T095348 are valid, but 2014-12-05T095348 and 20141205T09:53:48 are not.

链接地址: http://www.djcxy.com/p/35114.html

上一篇: 与ISO 8601相比,ECMAScript 5日期格式简化了什么

下一篇: xCBL的ISO 8601日期时间是否包含破折号?