This is the mail archive of the gnats-devel@sources.redhat.com mailing list for the GNATS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gnatsweb/235: Arrival-Date/Date-format in query-result is wrong



>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]