|
-
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.
-
Mar 31st, 2008, 02:18 PM
#2
Re: Christmas is greater than Christmas? W3C Date Comparison
Well they are different dates. You're including the time, therefore it's comparing the time. Why wouldn't it compare both the date and time if you are including both?
-
Mar 31st, 2008, 03:46 PM
#3
Re: Christmas is greater than Christmas? W3C Date Comparison
The format is such that it makes use of a timezone, those aren't actually times, for reasons that make me 
Why they get included escapes me, but the way I see it, a data type should represent... well, what it says on the box.
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
|