Re: [xslt] Troubles with the EXSLT date extensions



Hi there,

> You need to check the case of both negative days and seconds, otherwise
the
> result will end up with a negative sign in front of days after it is
formatted.
> I have attached a newer patch to difference.1.xml to illustrate the
problem.

Hmm... if both days and seconds are negative, then the result should be
negative, not true? Here is the current result with my code and the data
from your patch:

<!-- from bug #93444 -->
1970-01-01T04:03:02 - 1970-01-01T05:04:03 = PT1H1M1S
2000-01-01T04:03:02 - 2000-01-01T05:00:03 = PT57M1S
1980-01-01T04:03:02 - 2000-01-01T05:00:03 = P7305DT57M1S
<!-- from bug #92818 -->
2002-05-02T23:59:59 - 2002-05-03T00:00:01 = PT2S
2002-05-03T00:00:01 - 2002-05-02T23:59:59 = -PT2S
<!-- result should be negative -->
2000-01-01T04:03:02 - 2000-01-02T05:00:03 = P1DT57M1S

The last example is okay. It should not be negative, as the comment
suggests, because the first date occurs before the second and
http://exslt.org/date/functions/difference/index.html indicates that the
resulting duration is positive in that case. Other results are okay as well.

Am I missing something?

Ciao
Igor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]