[NTLUG:Discuss] standard and alternate time changes
Rusty Haddock
rusty at fe2o3.lonestar.org
Mon Jan 29 22:44:46 CST 2007
Fred James wrote:
>All
>In Linux I have found a reference to the environmental variable TZ in
>environ(5) (man and info), as a variable that gives "time zone
>information used by tzset(3)" but I have not found any indications of
>format.
>
>In SGI IRIX, I found information that would seem to indicate that ...
>"CST6:00:00CDT5:00:00,M3.2.0/2:00:00,M11.1.0/2:00:00"
>in the file /etc/TIMEZONE
>would cause CDT to begin at 2:00 AM on the 2nd Sunday of March, and end
>at 2:00 AM on the 1st Sunday of November.
>
>The form is given as
>stdoffset[dst[offset],[start[/time],end[/time]]] where one possible form
>of start/time,end/time is given as
>...
>I am guessing here, but might that work as the environmental variable
>TZ, set by /etc/profile?
Yes, if you really wanted to put all that into your TZ variable,
knock yerself out. Although, if you can't change the local system's
timezone info to deal with the new Daylight Saving Time that kicks in
this year... you may have to add the start and end sections to your
TZ variable.
>Any thoughts or experience? Thank you in advance for any help you
>may be able to offer.
What I've used (when the system had no timezone information) has been
simply 'std offset dst' (spaces used for clarity only) where std=CST
offset=6 dst=CDT thusly:
TZ=CST6CDT
The DST offset is optional and the offset does not need to specify the
minutes and seconds if they're all zeroes. Anyhoot, I believe that you
can shrink your TZ variable down a bit to:
TZ=CST6CDT,M3.2.0,M11.1.0
On my old version of Linux, the start & end times can be omitted if
they're 2am (which it has been in the US and will be under the new rules,
I believe). It seems that some of the embedded versions of Linux I use
at work appear to follow that same rule as well.
-Rusty-
P.S. Try this for an evil joke on someone: :-)
TZ=CST6:40TWILIGHT5:30,M1.2.3,M10.2.3
--
_____ Rusty Haddock = KD4WLZ = rusty at fe2o3.lonestar.org
|\/ o \ o **Out yonder in the Van Alstyne (TX) Metropolitan Area**
| ( -< O o Every day I think people can't get more stupid.
|/\__V__/ Every day I'm proven horribly wrong.
More information about the Discuss
mailing list