本文介绍了如果没有指定,XML Schema dateTime的默认时区是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试确定XML Schema dateTime的默认时区,当它不是特定的时候。最后的时区部分是可选的,可以省略:

I'm trying to determine what the default time zone is for an XML Schema dateTime, when it is not specific. The time zone portion at the end is optional and it may be omitted:

2013-01-11T16:02:55

我在指定时区未确定。我在评论中阅读了,如果没有指定,则默认为UTC。我还阅读了,并没有给我一个清楚的

I read in this answer that the time zone is undetermined when not specified. I read in the comments to this question that the default is UTC if not specified. I also read through the W3C definition and that didn't give me a clear answer.

任何专家可以指出我指定的地方吗?

Can any experts point me to where this is specified?

推荐答案

未指定的时区正是这个 - 未指定的。不多不少。这不是说它在UTC,也不是说它在当地时区或任何其他时区,只是说,从某个时钟读取的时间在那个时间。

An unspecified time zone is exactly that - unspecified. No more, no less. It's not saying it's in UTC, nor is it saying it's in the local time zone or any other time zone, it's just saying that the time read from some clock somewhere was that time.

事实上,它起源于 xs:dateTime 根本没有真正发挥。这只是一个ISO 8601日期+时间(没有时区)的价值。

The fact that it originated from an xs:dateTime doesn't really play into it at all. It's just an ISO 8601 date + time (without time zone) value.

这真的取决于你所做的这个值是什么这实际上意味着。

It really depends on what you do with this value as to what it actually means.

在现实世界中,使用时间戳时,您可能应该避免使用这样的值,即确切的时刻发生。对于那些您应该指定一个偏移量,如 -07:00 Z 来表示UTC。

In the real world, you probably should avoid values like this when working with timestamps - that is, the exact moment something occurs. For those you should specify an offset like -07:00, or a Z to indicate UTC.

如果未指定的值可能具有合法用途:

Where an unspecified value might have legitimate usage:


  • 未来事件按重发模式,并与时区(例如 America / New_York )配对。有关详细信息,请参阅我的的其他答案,和。

  • When scheduling future events by recurrence pattern, and paired with a time zone (such as America/New_York). For details, see other answers of mine here, here, and here.

当引用浮动时间时,这可能在多个时区的不同瞬间。示例:从下午7:00开始的网络电视节目。美国东部在美国西部之前会看到它,但是在每个区域仍然处于相同的浮动时间。

When referring to a "floating" time, that might be at a different instantaneous moment in multiple time zones. Example: A network television show that starts at 7:00 PM. The Eastern US would see it before the Western US, but it still airs at the same "floating" time in each zone.

当时区已经由某些其他机制所知,并且没有夏令时模糊的风险,或风险被接受和确定无关紧要。

When the time zone is already known by some other mechanism, and there is no risk of daylight saving time ambiguity, or when the risk is accepted and determined inconsequential.

这篇关于如果没有指定,XML Schema dateTime的默认时区是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 12:53