Beginner questions

Guy Harris guy at alum.mit.edu
Wed May 26 21:12:24 UTC 2004


On May 26, 2004, at 11:23 AM, Ruby Ballen wrote:

>
> Well, yes. What I was trying to say is if it is possible to do this:
>
> - When the user enables automatic DST calculations, use the regular 
> rules.
>
> - When the user disables automatic DST calculations, compute local 
> time using the offset that the
> time zone has when it is in standard time, regardless of DST being in 
> effect or not.

Yes.  As Paul Eggert said in his reply:

>> 2) Is it possible to disable DST changes when using this library?
>
> Sure; use (for example) TZ='MST7', which means to always use Mountain
> Standard Time without daylight-saving.  Such a setting would be
> appropriate for Phoenix, Arizona after 1968, for example.

Setting the TZ environment variable will affect only processes with 
that setting; for example, if you set it in a UN*X shell, the shell and 
the processes it creates will use that setting.  That won't affect 
other processes on the system, e.g. system daemons; you'd have to 
change some global time zone setting (however that's done on your 
particular system) to do that.

Note, however, that this does *NOT* let the user "move the clock 
forward/backward manually when DST is in effect", if by "the clock" you 
mean the system clock - on UN*Xes, the clock doesn't get moved when DST 
starts or ends, as Garrett Wollman noted.

What is the exact thing you're trying to do here?



More information about the tz mailing list