RE: Dates and Times in XML Schema Part 2

> 3. Schema-2 states that "The ˇvalue spaceˇ of dateTime is the space of
> Combinations of date and time of day values as defined in § 
> 5.4 of [ISO
> 8601]." The implication of this is that 2002-02-02T12:00:00Z 
> is a distinct
> value in the value space from 2002-02-02T07:00:00-05:00. But 
> if this is so,
> then the canonical lexical representation (which is always in UTC with
> timezone designator Z) cannot represent all values in the value space.
> [AM] The language may not be as clear as possible but the 
> value space represents instances of dateTime regardless of 
> the timezone used.  Thus, in your example above, where you 
> meant to indicate two lexical representations of the same 
> instant of time, both would map to the same value in the 
> value space.  

If this is so, it's extremely important that we understand its implications.

It means that if an XML document containing 2002-02-02T07:00:00-05:00 is
supplied as input to an identity transformation, the output document will
say 2002-02-02T12:00:00Z. 

It also means that if we have a function to extract the "hours" part of this
dateTime, the result will be 12, not 7 as the user might expect. 

And it means that the function xf:get-timezone-from-dateTime(), in the
current version of XQuery Functions and Operators, is meaningless. It is
supposed to return a string representing the timezone component of the
supplied dateTime, but from what you say above, the value space of dateTime
does not include a timezone. 

This is different from the way timezones are handled in SQL, where the
timezone is retained as part of the value.

Mike Kay

Received on Tuesday, 19 February 2002 12:25:22 UTC