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

RE: time order doesn't meet common sense

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Sat, 27 Oct 2001 11:37:22 -0700
Message-ID: <E5B814702B65CB4DA51644580E4853FB01040599@red-msg-12.redmond.corp.microsoft.com>
To: "Eric van der Vlist" <vdv@dyomedea.com>, <www-xml-schema-comments@w3.org>
You cannot subtract one time from another to get a duration.
You must use dateTime.

All the best, Ashok 
===========================================================


-----Original Message-----
From: Eric van der Vlist [mailto:vdv@dyomedea.com] 
Sent: Saturday, October 27, 2001 6:32 AM
To: www-xml-schema-comments@w3.org
Subject: xs:time order doesn't meet common sense

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 
leaving.

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 
(3.2.7.3) 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.
                    http://www.technoforum.fr/Pages/forumXML01/index.html
------------------------------------------------------------------------
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 14:37:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:57 GMT