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
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?
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.
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.
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:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With