Daylight Savings Time

guy at gorodish.UUCP guy at gorodish.UUCP
Thu Mar 12 18:17:31 AEST 1987


>I think the code modify of ctime.c and the recompile is a better fix. Still
>better is a feature in the future release of UNIX System software
>that has an /etc file similar to the /usr/lib/acct/holidays file
>that lets the administrator enter in the yearly on and off dates
>for daylight savings time.

Massively better than that is the code posted to "mod.sources" by
Robert Elz, written by Arthur Olson, Robert Elz, and others, that
does NOT require the administrator to do ANYTHING unless the rules
used to compute the start and stop dates for GMT change.  Schemes
that require the administrator to change something every year, to put
it bluntly, suck; why force the *administrator* to do work that the
*machine* can properly do?  (For that matter,
"/usr/lib/acct/holidays" isn't as good as it could be; it requires
you to enter day-of-year for holidays, and that's *another* thing the
machine should be computing given month and day values.)

Olson's scheme also will permit "ctime" and company to properly
convert times not in the current year - something which UNIX has been
able to do up to now, at least for times in the past, and which
schemes that *only* tell the system what the rules are for the
*current* year will *not* permit UNIX to be able to do.  Remember,
"not in the current year" does not necessarily mean "a long time
ago".  Times "not in the current year" may be times that are less
than 6 months ago; "ls" will print times as well as dates for
dates/times less than 6 months in the past.

Since this stuff was posted to mod.sources, people with source should
replace "ctime.c" with the code there; then, once they've recompiled
all the programs that use "ctime", "localtime", and company, they
won't have to change them again in the future.

>As for BSD, it may not even be an issue...

It's an issue.  It uses the same scheme that other UNIXes use; the
only difference is that it gets the offset from GMT, and a code
indicating which of the compiled-in rules it should use, from the
kernel.  It doesn't get the rules from the kernel.



More information about the Comp.unix.wizards mailing list