a timezone question ...

From: Lucio Chiappetti <lucio_at_ifctr.mi.cnr.it>
Date: Fri, 31 Mar 2000 14:29:22 +0200 (MET DST)

I thought that an easy way to obtain the "official" time in another timezone
(inclusive of DST setting) i.e. "what time is now in XXXX if here it is
hh:mm" was the following :

(set TZ timezone ; date)

this would set the TZ environment variable in a subshell without altering the
real machine timezone. The date man page says e.g.

  -u Performs operations as if the TZ environment variable was set to the
      string GMT0. Otherwise, date uses the time zone indicated by the TZ
      environment variable or the system default if that variable is not set.

However it appears that if I do that and setenv TZ to any of the zone names
listed in /etc/zoneinfo, I always get my date in MET. N.B. I have a link
localtime_at_ -> ./MET in /etc/zoneinfo.

What's wrong in my reasoning ?

----------------------------------------------------------------------------
Lucio Chiappetti - IFCTR/CNR - via Bassini 15 - I-20133 Milano (Italy)
----------------------------------------------------------------------------
"This land .. is my land .. e no xe una portaerei"
[English in the original] [and is not an aircraft carrier]
                             M.Paolini - I cani del gas - Bestiario italiano
----------------------------------------------------------------------------
For more info : http://www.ifctr.mi.cnr.it/~lucio/personal.html
----------------------------------------------------------------------------
Received on Fri Mar 31 2000 - 12:31:41 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT