Daylight savings time problem

Thad P Floryan thad at cup.portal.com
Tue Apr 4 19:47:28 AEST 1989


Re: people not having success with Lenny's DST patch posted last week ...

There are TWO clocks in the UNIXPC:

        1) line powered (more or less :-) Time Of Day (TOD), and

        2) battery-backed Real Time Clock (RTC).

When you (re-)boot the system, such as after having applied the patches, the
system's TOD is set from the RTC.

Since the RTC is operating on "local" time, not (UTC (prev. GMT)), you won't
see the desired and expected effect until you alter the RTC's registers by:

1) choose the "Administration" menu from "Office of install", select the
   "Date and Time" option, and manually correct the (date and) time,

2) set the time using "# date mmddhhmm" followed by "# date -" (to reset the
   RTC's registers),

3) write a "one-line" program using syslocal() to alter the RTC's registers,

4) run my version of the "utc" program which cu's the US Naval Observatory's
   time service in Washington, DC to adjust both the TOD and RTC clocks, or

5) run my "nbswwv" program which reads the serial port of the HeathKit GC-1000
   clock (getting the time from WWV in Fort Collins or WWVH in Hawaii) to
   adjust both the TOD and RTC clocks.

If there's any interest (need I ask? :-), I can post the sources to these and
some other date and time stuff to unix-pc.sources.

Note, also, that one should patch, per Lenny's comments, at least /lib/shlib
and /etc/smgr.  On my systems I was unable to directly alter /etc/smgr since
it had some file(s) open, so I had to resort to the following:

        # cd /etc
        # dstconvert smgr smgr-new

        shutdown the system (still powered-up), then:

        reboot from the Floppy Boot Disk (and Floppy Filesystem, being sure
        to abort (using shift-ESC when asked the question about clobbering
        the hard disk)), then:

        # cd /mnt/etc          # which goes to the HD's /etc
        # rm smgr              # delete the old smgr having pre-1988 DST rules
        # mv smgr-new smgr     # rename the new smgr having new 1988 DST rules
        # sync;sync;sync       # assure disk buffers are flushed
        # cd /                 # return to the floppy filesystem

        then remove the floppy disk and press the reset button (at the back of
        the system) to reboot from HD.

One should also patch the ctime in /lib/libc.a and any other programs that do
NOT use the sharable library.  My thanks to Lenny for his dstconvert program!

And, finally, contrary to some comments I've just read in this newsgroup, one
does NOT have to have one's system powered-up and running at the time of the
DST switch in order for the change to take effect.  UNIX (internally) operates
on GMT; it is ONLY the library routines which are cognizant of one's time zone
and other oddities (such as Daylight Stupid Time) that adjust the date and
time FOR DISPLAY PURPOSES ONLY.  Repeating: all internal dates and times are
GMT and only "external" dates and times are adjusted per the time zone data in
/etc/TZ (and the correspondingly-set shell variable TZ).

Please direct non-UNIXPC comments concerning DST (Dumb Stupid Time) to
alt.flames or /dev/null ... the whole idea of diddling the world's clocks is
ludicrous; if one wants "more" daylight hours, just awaken earlier.  Sheesh.

Thad Floryan [ thad at cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]



More information about the Unix-pc.general mailing list