|
-
Mar 31st, 2008, 02:06 PM
#1
Christmas is greater than Christmas? W3C Date Comparison
Looking at the XQuery/XPath specifications, it says
op:date-greater-than(xs:date("2004-12-25Z"), xs:date("2004-12-25+07:00")) returns true.
op:date-greater-than(xs:date("2004-12-25-12:00"), xs:date("2004-12-26+12:00")) returns false.
To put this in a polite way, it seems to be rather idiotic. When comparing two dates, the time zone or the time should not factor into anything. To stick with these standards means that when I compare two dates 'given' in an ISO format from 'wherever', I need to perform string manipulations to ensure that there are no Zulu or Time-Zones appended to the date. To imply that Christmas in Cambodia is 'less than' Christmas in the UK does not make sense. They're both December 25, and such a comparison would be valid if we were comparing times.
What's the logical reasoning behind this specification? Please don't reply in a manner to give W3C the benefit of the doubt, simply because they may be infallible to you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|