This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2413 - op-subtract-dayTimeDuration-from-date-7 and -1 wrong result
Summary: op-subtract-dayTimeDuration-from-date-7 and -1 wrong result
Status: CLOSED DUPLICATE of bug 2386
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.7.0
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-24 13:34 UTC by Martin Probst
Modified: 2006-08-09 10:09 UTC (History)
0 users

See Also:


Attachments

Description Martin Probst 2005-10-24 13:34:53 UTC
Both of these queries subtract a little over a day from an xs:date. In both
cases the result is one day off - at least I think so. I.e. -7:

The query in op-subtract-dayTimeDuration-from-date-7 is:
> fn:string(xs:date("1989-07-05Z") - xdt:dayTimeDuration("P01DT09H02M"))

Expected result is: 1989-07-04Z

I believe it should be 1989-07-03Z as the dayTimeDuration is a little over one
day and dates are defined to be starting at 00:00:00, so subtracting a little
more than a day and discarding the time part thereafter should yield the 3rd.

Same goes for -1, which cites below example, but actually presents different
results.

See also
http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date
which includes a very similar example.
Comment 1 Martin Probst 2005-10-24 14:16:15 UTC
...

*** This bug has been marked as a duplicate of 2386 ***