- From: Sandy Gao <sandygao@ca.ibm.com>
- Date: Thu, 5 May 2005 11:43:05 -0400
- To: www-xml-schema-comments@w3.org
- Message-ID: <OF6BC88F60.BF16D86B-ON85256FF8.0055F8F7-85256FF8.00565A57@ca.ibm.com>
The ordering between two dateTimes P and Q is defined by the following
algorithm:
A.Normalize P and Q. That is, if there is a timezone present, but it is
not Z, convert it to Z using the addition operation defined in Adding
durations to dateTimes (§E)
Thus 2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z
B. If P and Q either both have a time zone or both do not have a time
zone, compare P and Q field by field from the year field down to the
second field, and return a result as soon as it can be determined. That
is:
1. For each i in {year, month, day, hour, minute, second}
a. If P[i] and Q[i] are both not specified, continue to the next i
b. If P[i] is not specified and Q[i] is, or vice versa, stop and
return P <> Q
c. If P[i] < Q[i], stop and return P < Q
d. If P[i] > Q[i], stop and return P > Q
2. Stop and return P = Q
C.Otherwise, if P contains a time zone and Q does not, compare as follows:
1. P < Q if P < (Q with time zone +14:00)
2. P > Q if P > (Q with time zone -14:00)
3. P <> Q otherwise, that is, if (Q with time zone +14:00) < P < (Q
with time zone -14:00)
D. Otherwise, if P does not contain a time zone and Q does, compare as
follows:
1. P < Q if (P with time zone -14:00) < Q.
2. P > Q if (P with time zone +14:00) > Q.
3. P <> Q otherwise, that is, if (P with time zone +14:00) < Q < (P
with time zone -14:00)
Problems:
1. Step A is not necessary. Time zones are already normalized when we
convert lexical reps to values. (There is no timezone property in the
value, only a boolean timezoned.)
2. How can the situation described in B.1.b ever happen?
3. C.3. Shouldn't it be Q with +14 <= P <= Q with -14
4. Similarly in D.3, shouldn't it be P with +14 <= Q <= P with -14
Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com
Received on Thursday, 5 May 2005 15:43:11 UTC