ISO 8601日期时间表示 [英] ISO 8601 DateTime representation

查看:445
本文介绍了ISO 8601日期时间表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是DateTime的有效ISO 8601表示形式吗?

Is this a valid ISO 8601 representation of DateTime?


20170704T09:30:00 + 0530

20170704T09:30:00+0530

ie是否可以同时使用基本格式和扩展格式?还是应该仅是以下之一:

i.e. whether a combination of both the basic and extended formats can be used? Or should it only be either of these:


20170704T093000 + 0530

2017-07-04T09:30:00 +05:30

20170704T093000+0530
2017-07-04T09:30:00+05:30


推荐答案

在Wikipedia 中,它表示日期和时间的组合表示形式可以是基本格式或扩展格式,但日期和时间必须使用

In Wikipedia, it says that a combined date and time representation can be in basic or extended format, but both date and time must use the same format.

ISO 8601 ,也没有提到混合表示-请查看 4.3.2 部分中的示例。尽管我找不到关于混合格式的明确声明,但在我看来,您不能以相同的表示形式混合基本格式和扩展格式。

In ISO 8601, there's no mention of a mixed representation as well - take a look the examples in section 4.3.2. Although I couldn't find an explicit statement about mixing formats, it seems to me that you can't mix basic and extended formats in the same representation.

,我会说像 20170704T09:30:00 + 0530 这样的格式在ISO 8601中无效无效。

That being said, I would say that a format like 20170704T09:30:00+0530 is not valid in ISO 8601.

这篇关于ISO 8601日期时间表示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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