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

Bug report, com.w3c.util.DateParser

From: Brian <ic547@yahoo.com>
Date: Wed, 18 May 2005 06:25:31 +0000
Message-ID: <20050518062521.19601.qmail@web32614.mail.mud.yahoo.com>
To: www-jigsaw@w3.org, jigsaw@w3.org

I tried to send a message to the author of the DateParser class
regarding a possible bug, but I received a delivery failure.  So, I am
hoping this is the correct place to submit the report.  Please see


A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es)

    (generated from bmahe@w3.org)
    SMTP error from remote mailer after RCPT
    host sophia.inria.fr []: 550 5.7.0
<bmahe@sophia.inria.fr>... No such user here

------ This is a copy of the message, including all the headers. ------

Date: Tue, 17 May 2005 23:01:09 -0700
To: bmahe@w3.org
From: Brian <ic547@yahoo.com>
Subject: Bug report, com.w3c.util.DateParser

I am using your DateParser class revision 1.4 from
Thank you very much for the work.  It is very helpful.
In my usage, I believe I may have found a malfunction, but perhaps I am
misunderstanding something.
Here is an example of what I have found... 
I am parsing this date string using DateParser.parse(String):
The returned date appears to be incorrect in the time zone field...

The result of calling toGMTString() on the return value is:
    17 May 2005 08:28:11 GMT
The result of calling toLocaleString() on the return value in the
(-07:00 time zone) is:
    May 17, 2005 1:28:11 AM
I noticed that the result was off from what I expected by exactly twice
the time zone value and suspected that the problem could be in the math
of the time zone adjustments.
Lines 146 - 152 of the source code are:
146  if (plus) {
147      calendar.add(Calendar.HOUR, tzhour);
148      calendar.add(Calendar.MINUTE, tzmin);
149  } else {
150      calendar.add(Calendar.HOUR, -tzhour);
151      calendar.add(Calendar.MINUTE, -tzmin);
152  }
I changed line 146 to:
146  if (!plus) {

This has fixed my problem and the dates now appear to be coming out
The result of calling toGMTString() on the return value is now:
    17 May 2005 22:28:11 GMT
The result of calling toLocaleString() on the return value in the
(-07:00 time zone) is now:
    May 17, 2005 3:28:11 PM
I thought I would report this in case it is a bug in the code.  If not,
and if I am misunderstanding the usage, please advise me of my mistake.
Thank you,

Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
Received on Wednesday, 18 May 2005 09:47:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:39 UTC