Daylight savings
Kurt Wall
kwall
Mon May 17 12:01:06 PDT 2004
In a 1.1K blaze of typing glory, Kevin O'Gorman wrote:
> I've got an old RedHat 7.3 that works well for me, but I've
> always had a bit of trouble about the daylight savings stuff.
>
> The machine is set to PDT, but does not adjust automatically,
> so when daylight savings is off, things get weird. I cannot
> figure out how to get it set properly. Any clues?
>
> What I know:
> /etc/timezone says "America/Los_Angeles" and this
> appears to name a subdirectory and file of
> /usr/share/zoneinfo, pointing to a binary file.
IIRC, the binary file contains a few bits that C library time
handling functions use to control interpretation of the local
time zone information.
> I do not seem to run with a TZ or TIMEZONE environment
> variable
> The 'tzselect' program does not give me any options
> related to daylight savings.
Nope. However, inside the bowels of the C library, various time-related
functions handle the guts of timekeeping automatically. Specifically,
tzset() is called when any of the library time conversion and manipulation
functions are called (ctime(), gettimeofday(), yadda yadda). When tzset()
is called, it sets a variable named daylight, which controls whether or
not the rules for handling daylight savings time are in effect (*not*
necessarily that it *is* currently DST, only that the rules for handling
DST need to be observed).
> What I don't know:
> where the PST/PDT choice is made, or why PDT is shown
> in the output of the 'date' command, other than
> that I remember their being such an option during
> the initial software installation.
Some installers let you specify whether or not to use daylight
savings time. Others don't. The choice is made inside the C library
based on the current time, modulo how system time is set and maintained
(hwclock, NTP, or whatever).
I've been working on an article on localization and have lost more time
than I care to admit trying to understand how all of the timekeeping
conventions and standards are handled. Short version: what a bloody
nightmare. It makes me think of one of the French kings (Louis XIV
perhaps?) who spent his retirement trying to get two clocks to keep
perfect time with each other - a metaphor for the aggravation he
endured trying to keep France and England synched up).
Kurt
--
First Corollary of Taber's Second Law:
Machines that piss people off get murdered.
-- Pat Taber
More information about the Linux-users
mailing list