W3C home > Mailing lists > Public > public-rif-wg@w3.org > March 2010

Re: [testcases] bugs in datetime subtraction

From: Stella Mitchell <stellamit@gmail.com>
Date: Sun, 21 Mar 2010 11:42:53 -0400
Message-ID: <d64b0f2c1003210842s594eb71fjb24c70e048091c77@mail.gmail.com>
To: Gary Hallmark <gary.hallmark@oracle.com>
Cc: RIF WG <public-rif-wg@w3.org>
Gary,

Thank you for finding these bugs.  I would make the following changes to
your answers. Do you agree?

On Tue, Mar 16, 2010 at 6:57 PM, Gary Hallmark <gary.hallmark@oracle.com>wrote:

>
> External( func:subtract-dateTimes( "2000-10-30T06:12:00Z"^^xs:dateTime
> "1999-11-28T09:00:00Z"^^xs:dateTime) ) = "P337DT21H12M"^^xs:dayTimeDuration
> External( func:subtract-dates( "2000-10-30"^^xs:date "1999-11-28"^^xs:date
> ) ) = "P338D"^^xs:dayTimeDuration
> External( func:subtract-times( "11:12:00Z"^^xs:time "04:00:00Z"^^xs:time )
> ) = "PT7H12M"^^xs:dayTimeDuration
>

 External( func:subtract-dateTimes( "2000-10-30T06:12:00*-05:00*"^^xs:dateTime
"1999-11-28T09:00:00Z"^^xs:dateTime) ) = "P337DT*2*H12M"^^xs:dayTimeDuration
       (This was the original intent, I think, to match the example given at
the end of http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes ,
and it adds some variety to the subtract-times line where both arguments
have the same timezone


External( func:subtract-dates( "2000-10-30*Z*"^^xs:date
"1999-11-28*Z*"^^xs:date
) ) = "P*337*D"^^xs:dayTimeDuration
       (Adding Z because RIF DTB requires explicit timezones.  Check your
count of the duration from the first instant of 1999-11-28 to the first
instant of 2000-10-30? and take into account that the first example at the
end of http://www.w3.org/TR/xpath-functions/#func-subtract-dates says 337 is
the right answer)

Stella

On Tue, Mar 16, 2010 at 6:57 PM, Gary Hallmark <gary.hallmark@oracle.com>wrote:

> In the BuiltinsTime test case, I think the following
>
> External( func:subtract-dateTimes( "2000-10-30T06:12:00"^^xs:dateTime
> "1999-11-28T09:00:00Z"^^xs:dateTime) ) = "P337DT2H12M"^^xs:dayTimeDuration
> External( func:subtract-dates( "2000-10-30"^^xs:date "1999-11-28"^^xs:date
> ) ) = "P337D"^^xs:dayTimeDuration
> External( func:subtract-times( "11:12:00Z"^^xs:time "04:00:00"^^xs:time ) )
> = "PT2H12M"^^xs:dayTimeDuration
>
> should be changed to
>
> External( func:subtract-dateTimes( "2000-10-30T06:12:00Z"^^xs:dateTime
> "1999-11-28T09:00:00Z"^^xs:dateTime) ) = "P337DT21H12M"^^xs:dayTimeDuration
> External( func:subtract-dates( "2000-10-30"^^xs:date "1999-11-28"^^xs:date
> ) ) = "P338D"^^xs:dayTimeDuration
> External( func:subtract-times( "11:12:00Z"^^xs:time "04:00:00Z"^^xs:time )
> ) = "PT7H12M"^^xs:dayTimeDuration
>
>
>
>
>
>
Received on Sunday, 21 March 2010 15:43:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 21 March 2010 15:43:31 GMT