Problem with timezones in 'date' command
Christian Bauer <[email protected]> Wed, 09 Apr 2003 15:05:05 +0200
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Organization | NEFkom Telekommunikation GmbH & Co. KG |
| Message-ID | <[email protected]> |
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:[email protected]