bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with timezones in 'date' command


From: Christian Bauer
Subject: Problem with timezones in 'date' command
Date: Wed, 09 Apr 2003 15:05:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

Hi there,

I've got some troubles with the 'date' command and its timezone-interpreting.

it seems that it support not all timezone-names.
i can use CET for 'Central European Time'
and MESZ for 'Mittel Europäische Sommer Zeit'

but it seems i can't use the english version for Central European Summer Time (CEST)
and the german version for MEZ (Mittel Europäische Zeit)

i had a look in lib/getdate.c (sh-utils-2.0)
and here an abridgement of the code:

   { "cet",    tZONE,     -HOUR (1) }, /* Central European */
   { "met",    tZONE,     -HOUR (1) }, /* Middle European */
   { "mewt",   tZONE,     -HOUR (1) }, /* Middle European Winter */
   { "mest",   tDAYZONE,  -HOUR (1) }, /* Middle European Summer */
   { "mesz",   tDAYZONE,  -HOUR (1) }, /* Middle European Summer */

i searchad a lot in RFCs and found that there is no real standard for timezone-names.

but maybe you will implement these timezones. it would be very useful
for european people.

but a very bad thing is, that the date-command outputs no error if you have a unknown timezone.
so
date +'%s' --date="WED APR 09 12:59:11 cest 2003"
will produce the same output like
date +'%s' --date="WED APR 09 12:59:11 cet 2003"

that costs me many time to find this bug in a complex shell-script :-((((((

thanks for help,

Chris

--
NEFkom Telekommunikation GmbH & Co.
Spittlertorgraben 13            Tel. 0911/1808-18
D-90429 Nuernberg               Fax. 0911/1808-409
http://www.NEFkom.de            mailto:address@hidden







reply via email to

[Prev in Thread] Current Thread [Next in Thread]