W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2008

[Bug 5939] New: Unintuitive results from op:time-equal

From: <bugzilla@wiggum.w3.org>
Date: Thu, 07 Aug 2008 10:39:18 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-5939-523@http.www.w3.org/Bugs/Public/>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5939

           Summary: Unintuitive results from op:time-equal
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: oliver@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


The way that op:time-equal is currently defined leads to some unintuitive
results.

For example I would have expected that adjusting the timezone of a time would
not affect the comparison, since it still represents the same point in time.

However consider the following query:

let $time := xs:time("23:00:00Z")
return adjust-time-to-timezone($time, xs:dayTimeDuration("PT2H"))
     = adjust-time-to-timezone($time, xs:dayTimeDuration("-PT2H"))

The two arguments yield the times 01:00:00+02:00 and 21:00:00-02:00.
Although these times refer to the same point in time, after they are converted
to xs:dateTimes their values differ by 24 hours, and so the result is false.

This seems very counter-intuitive.  Perhaps the normalization to the context
timezone should occur before conversion to xs:dateTime; or at least this case
should be mentioned in the specification.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 7 August 2008 10:39:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:53 GMT