W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 2005

Re: org.w3c.util.DateParser timezone bug

From: Yves Lafon <ylafon@w3.org>
Date: Mon, 16 May 2005 14:04:13 +0200 (MEST)
To: Menno Jonkers <lists_w3_org@jonkers.com>
cc: www-jigsaw@w3.org
Message-ID: <Pine.GSO.4.63.0505161402140.24066@gnenaghyn.vaevn.se>
On Wed, 11 May 2005, Menno Jonkers wrote:

> Hi,
>
> I'm under the impression that the getCalendar() method in
> org.w3c.util.DateParser handles the time zone the wrong way around.
>
> In the example at [1] it is explained how these ISO dates both
> correspond to November 5, 1994, 8:15:30 am, US Eastern Standard Time:
>
> 1994-11-05T08:15:30-05:00
> 1994-11-05T13:15:30Z
>
> Yet when running these through DateParser.parse() I get:
>
> Sat Nov 05 04:15:30 CET 1994
> Sat Nov 05 14:15:30 CET 1994
>
> These differ (and are in my CET zone, but that shouldn't matter).

java org.w3c.tools.util.DateParser will also output the same error.
I used your patch (and added another test) and now the output is:

----------------------------------
>> 1997-07-16T19:20:30+01:00
>> Wed Jul 16 20:20:30 CEST 1997 [869077230000]
>> 1997-07-16T18:20:30.00Z
----------------------------------
----------------------------------
>> 1997-07-16T12:20:30-06:00
>> Wed Jul 16 20:20:30 CEST 1997 [869077230000]
>> 1997-07-16T18:20:30.00Z
----------------------------------

Which is the expected output.
Thanks for catching this! (and sorry for the delay).
Best regards,

-- 
Yves Lafon - W3C
"Baroula que barouleras, au tiéu toujou t'entourneras."
Received on Monday, 16 May 2005 12:34:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:37 GMT