W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2001

xs:time order doesn't meet common sense

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Sat, 27 Oct 2001 15:32:05 +0200
Message-ID: <3BDAB755.3030609@dyomedea.com>
To: www-xml-schema-comments@w3.org
When defining a time format with hours between 0 and 24, ISO 8601 has 
not defined any order relation on these values... and this is leading to 
weird consequences!

Let's take the example of a plane with a daily summer time schedule 
leaving San Francisco at 16:30:00-07:00 to arrive in Paris at 
10:45:00+02:00 the next day.

The definition of the order between those two times given by W3C XML 
Schema would lead us to the conclusion that this plane arrives before 

This problem might be solved if values greater than 24 were accepted for 
the hour (the plane would then arrive at 34:45:00+02:00, ie 25:45:00-07:00).

What is especially inconsitent is that the actual value space of xs:time 
is already exceeding the 24 hours to cover the 52 hours from 00:00:00+14 
to 24:00:00-14!

This means that by carefully selecting the timezones one might be able 
to get planes which arrive after leaving.

To go back to our example, 16:30:00-07:00 is also 01:30:00+02:00 (the 
next day) and the plane is flying from 01:30:00+02:00 to 10:45:00+02:00...

This cannot be extended to be the general case (the flight may have been 
longer) and relaxing the constraint on the range of the hours part would 
only generalize something which is already allowed...

I think that the issue is coming from the definition of the order 
relation for xs:time:

"The order relation on time values is the Order relation on dateTime 
( using an arbitrary date. "

This doesn't really make sense since xs:time is a recurring point in 
time, not a duration. The consequence is that by changing the timezone 
of the arbitrary date, you can change the result of the comparison.

Eric (jetlagged after this exercise)
Rendez-vous  Paris pour le Forum XML.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
Received on Saturday, 27 October 2001 11:59:40 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:57 UTC