This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The query is xs:dateTime("0001-01-01T01:01:01Z") - xs:dateTime("2005-07-06T12:12:12Z") The supplied answer is -P732134DT11H11M11S I believe the correct answer is: -P732132DT11H11M11S Rationale: Between 0001-01-01 and 2005-01-01 there are 2004 years. Of these 486 are leap years (2004/4 minus the fifteen years 100, 200, 300, 500, 600, 700, 900, 1000, 1100, 1300, 1400, 1500, 1700, 1800, 1900). 2004*365 + 486 = 731946 Add 186 for the days between 2005-01-01 and 2005-07-06 731946 + 186 = 732132 Michael Kay
Also affects op-subtract-dates-yielding-DTD-8 which is incorrectly identified as subtract-dayTimeDuration-from-date-8 (twice) in the comment banner within the test file)
I re-ran the tests and got the same answer. Since the purpose is to get a negative answer, I changed the tests to use closer dates and dateTimes. Resubmitted changed tests and new results. Please close the bug if you agree with resolution. Thanks, Carmelo
If this test is finding bugs in implementations, then it seems to serve a useful purpose, and it's a shame to replace it with a test that implementations find it easier to pass. (I suspect the published results are what you get if you do the arithmetic using a proleptic Julian claendar rather than a proleptic Gregorian calendar). It would be better to keep the test and correct the expected results.
Revising test. Carmelo
Mike: You are correct. Resubmitted original tests (corrected names inside test cases) and suggested expected results. Please close bug if in agreement. Thanks, Carmelo Montanez
Michael, I think the correct result is -P732134DT11H11M11S, as it looks like the years 4 A.D. and 8 A.D. were not declared leap years. Try to go to the page http://www.numerical-recipes.com/julian.html and enter Jan 1 0001 as the starting date, 732134 as the number of days and check that the result is Jul 6 2005 Alberto
Also, the same applies to op-subtract-dates-yielding-DTD-8
XPath arithmetic and the XML Schema dateTime type use a proleptic Gregorian calendar, in which AD 4 and AD 8 are indeed leap years. http://en.wikipedia.org/wiki/Proleptic_Gregorian_Calendar
We seems to be ok here.