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 2386 - op-add-dayTimeDuration-to-date-8 results are wrong
Summary: op-add-dayTimeDuration-to-date-8 results are wrong
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.7.0
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact:
URL:
Whiteboard:
Keywords:
: 2413 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-19 18:15 UTC by Michael Kay
Modified: 2006-06-22 12:56 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2005-10-19 18:15:52 UTC
I believe the results of op-add-dayTimeDuration-to-date-8 are wrong.

The query is

xs:date("0001-01-01Z") + xdt:dayTimeDuration("-P11DT02H02M")

and the expected results are

-0001-12-21Z

I think the correct result is

-0001-12-20Z

The rule in 10.8.9 is that you subtract the duration from the starting instant
of the date, and then remove the time component from the result. Subtracting 11
days and two hours from 1 Jan 0001 gives you a time around 10pm on 20 Dec 0001
BC, and removing the time components gives you -0001-12-20
Comment 1 Michael Kay 2005-10-19 18:19:40 UTC
Same problem applies to:

op-subtract-dayTimeDuration-from-date-1

(Note, Saxon 8.5.1 gives the incorrect results as published, but my code has now
been corrected in response to other tests in XQTS!)
Comment 2 Michael Kay 2005-10-19 18:21:44 UTC
Applies also to

op-subtract-dayTimeDuration-from-date-7
op-subtract-dayTimeDuration-from-date-8
Comment 3 Martin Probst 2005-10-24 14:16:18 UTC
*** Bug 2413 has been marked as a duplicate of this bug. ***
Comment 4 Carmelo Montanez 2005-10-27 19:22:21 UTC
Agree.  Submitted new test results.  Please close the bug if you agree
with the resolution.

Thanks,
Carmelo