在ISO 8601的日期,T字符是否是强制性的? [英] In an ISO 8601 date, is the T character mandatory?

查看:135
本文介绍了在ISO 8601的日期,T字符是否是强制性的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道以下日期是否符合ISO8601:

  2012-03-02 14:57:05.456+ 0500 

(肯定是2012-03-02T14:57:05.456 + 0500是合规的,但不符合这么多人可读!)
IOW,是日期和时间之间的T是否必须强制?

解决方案

除非信息交流伙伴同意省略。



引用 ISO 8601标准,第4.3.2节:


字符[T]用作时间指示符,用于指示
开始表示这些
表达式中的时间组件。 [...]



注意通过信息交换中的合作伙伴的相互协议,
在没有$的应用程序中可以省略字符[T] b / b

$ b

省略它,b $ b将日期和日期表示与其他人的
的风险混淆在本国际标准中。是相当普遍的,但如果代表意图是机器可读的,并且您没有明确的协议,您可以省略它,那么它是可取的。


I'm wondering if the following date is ISO8601 compliant :

2012-03-02 14:57:05.456+0500

(for sure, 2012-03-02T14:57:05.456+0500 is compliant, but not that much human readable !) IOW, is the T between date and time mandatory ?

解决方案

It's required unless the "partners in information interchange" agree to omit it.

Quoting the ISO 8601 standard, section 4.3.2:

The character [T] shall be used as time designator to indicate the start of the representation of the time of day component in these expressions. [...]

NOTE By mutual agreement of the partners in information interchange, the character [T] may be omitted in applications where there is no risk of confusing a date and time of day representation with others defined in this International Standard.

Omitting it is fairly common, but leaving it in is advisable if the representation is meant to be machine-readable and you don't have a clear agreement that you can omit it.

这篇关于在ISO 8601的日期,T字符是否是强制性的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆