xCBL 文档与日期时间格式的 ISO 8601 标准之间似乎存在差异。
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
正如您在上面的链接中看到的,xCBL 标准在描述 ISO8601 时,日期中没有破折号,而 wikipedia 和 w3 都使用破折号进行描述。
有人对此有最后的说法吗?我正在为 API 开发一个应用程序,该应用程序“按照 xCBL 标准”请求 ISO 8601 格式的日期时间,但由于定义方式不同而导致冲突。
最佳答案
我无权访问该标准,但维基百科明确表示 YYYYMMDDTHH:MM:SS[[+-]HH:MM] 等格式不是有效的 ISO 日期。如果任何有权访问该标准的人都可以检查它并在评论中确认它或修复我的答案和维基百科文章,我将非常高兴。
即,the Wikipedia article表示“单个时间点可以通过连接完整的日期表达式、作为分隔符的字母 T 和有效的时间表达式来表示。/.../可以使用基本格式或扩展格式,但两种日期和时间必须使用相同的格式。” (粗体格式是我设计的)。这意味着例如2014-12-05T09:53:48 和 20141205T095348 有效,但 2014-12-05T095348 和 20141205T09:53:48 无效。
关于datetime - xCBL 的 ISO 8601 日期时间是否应该包含破折号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24209634/