commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <flame...@gmail.com>
Subject Re: Time bugs Was: [lang] FastDateFormat year bug
Date Sun, 12 Sep 2004 04:47:30 GMT
Actually, I retract this. If it switches to P'y'Y, then it won't print
out 2002 but 02 when it does large durations. I think the 'hack' of
using a DateFormat to format durations is stretched here.

So 2 problems now. Years are broke in ISO_EXTENDED and dates are broke
in FastDateFormat.

Hen


On Sun, 12 Sep 2004 00:40:51 -0400, Henri Yandell <flamefew@gmail.com> wrote:

> testISODurationFormat:
>         // test fixture from example in
> http://www.w3.org/TR/xmlschema-2/#duration
>         cal.set(1, 1, 3, 10, 30, 0);
>         cal.set(Calendar.MILLISECOND, 0);
>         text = DurationFormatUtils.ISO_EXTENDED_FORMAT.format(cal);
>         assertEquals("P1Y2M3DT10H30M0.0S", text);
> 
> This is, I believe, a bug in our pattern:
> 
> ISO_EXTENDED_FORMAT_PATTERN = "'P'yyyy'Y'M'M'd'DT'H'H'm'M's.S'S'"
> 
> should be:
> 
> ISO_EXTENDED_FORMAT_PATTERN = "'P'y'Y'M'M'd'DT'H'H'm'M's.S'S'"

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message