public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* Re: gnatsweb/235: Arrival-Date/Date-format in query-result is wrong
       [not found] <20010809040501.27652.qmail@sourceware.cygnus.com>
@ 2001-08-15 11:20 ` Yngve Svendsen
  0 siblings, 0 replies; only message in thread
From: Yngve Svendsen @ 2001-08-15 11:20 UTC (permalink / raw)
  To: aavictor, gnats-gnats; +Cc: gnats-devel

>Background : End users complain the arrival-time is not relevent to 
>Hongkong time. So, I change the timezone of system clock from CST to HKT , 
>and reboot. After that,
>I create a test request on "Thu Aug 09 10:10:00 HKT 2001" , and output in 
>Query Results is "1970-01-01 07:59:59".
>The arrival time of this request is -1 in index (gnats-adm directory)

(I am CCing the gnats-devel mailing list on this, as I think others might 
be interested in this)

Interesting problem. It seems to be a side-effect of GNATS not having heard 
of the HKT time zone name abbreviation, and I think it is caused by the 
following:

When GNATS receives a problem report, it takes the current date and time 
from the clock on the server and puts that into the Arrival-Date field of 
the GNATS report. No parsing is involved, so it doesn't matter if the 
server uses a format that GNATS doesn't understand.

However, GNATS also uses an index file to make searching faster. The 
Arrival Date is one of the fields in this index, and when creating it, 
GNATS attempts to parse the date string into an internal format. Not 
knowing what to make of the "HKT" in the date string, it seems to default 
to putting "-1" into the index field. This -1 is what causes the wrong date 
which you are seeing in the Gnatsweb query results.

So, all in all, this is not really a Gnatsweb problem, but a problem in 
GNATS itself. There are myriads of different timezone abbreviations, and 
GNATS unfortunately doesn't know about all of them. The upcoming GNATS 4 
has largely solved this by using numeric time zone strings relative to UTC, 
like +0200 or -0800.

I think the best workaround for you would be to set a timezone on your 
server which is known to GNATS. As far as I can see, HKT is UTC+8 hours, so 
you should get by with either of the following, cut from the GNATS 
getdate.y file:

     { "awst",   tZONE,     -HOUR (8) }, /* West Australian Standard */
     { "cct",    tZONE,     -HOUR (8) }, /* China Coast, USSR Zone 7 */
     { "pht",    tZONE,     -HOUR (8) }, /* Asia Manila */
     { "wst",    tZONE,     -HOUR (8) }, /* West Australian Standard */

You could also try to insert the HKT timezone in the proper location of the 
getdate.c file and recompile GNATS. The format of the time zone entries in 
getdate.c should be more or less self-explanatory.

By the way, you should definitely update your Gnatsweb installation. 
Functionality has improved quite a bit lately, and versions up to and 
including Gnatsweb 2.8.1 have a nasty security hole. You can find out more 
about this at http://sources.redhat.com/gnats/

Yngve Svendsen
Gnatsweb maintainer

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-15 11:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20010809040501.27652.qmail@sourceware.cygnus.com>
2001-08-15 11:20 ` gnatsweb/235: Arrival-Date/Date-format in query-result is wrong Yngve Svendsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).