Subject: Re: Something odd about timezones
To: Tld <tld@tld.digitalcurse.com>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-help
Date: 02/06/2003 17:21:57
>I live in Italy, GMT+1.
>I have a NetBSD machine (1.6 currently) whose kernel is set to have a 0 
>minutes west of GMT (west???). Hence, hardware clock is set to GMT.
>I have a symlink for /etc/localtime to /usr/share/zoneinfo/Etc/GMT+1
>
>Now the problems:
>1) "date" gives the time 2 hours behind localtime (as if I told it to use 
>GMT-1)

your local time is one hour ahead of gmt, so you need to substract one
hour to calculate gmt.  use GMT-1.  i need to add five hours to
calculate gmt (from north america), so i am at GMT+5.

>2) sending mails puts headers like this: (from a mail I sent today)
>Date: Thu, 6 Feb 2003 12:00:18 -0100 (GMT+1)
>Now, GMT time is still correct (13:00:18) but local time was 14:00:18, the 
>time should be +0100 (GMT+1) not -0100 (GMT-1)
>
>I really don't understand what and why happens.

i would suggest using one of more readable zones like Europe/Rome,
Europe/Vatican, Europe/San_Marino, or Europe/Malta, depending on your
taste.  otherwise, you should switch to Etc/GMT-1.

the names of the zones in etc were picked from the "other" point of
view (ie, what do you need to do to your local time to calculate gmt
instead of what do you need to do to gmt to calculate your local
time).  to quote from src/share/zoneinfo/etcetera:

# We use POSIX-style signs in the Zone names and the output abbreviations,
# even though this is the opposite of what many people expect.
# POSIX has positive signs west of Greenwich, but many people expect
# positive signs east of Greenwich.  For example, TZ='Etc/GMT+4' uses
# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC
# (i.e. west of Greenwich) even though many people would expect it to
# mean 4 hours ahead of UTC (i.e. east of Greenwich).

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."