[BC] DST for the rest of you

richardbrianjohnson at verizon.net richardbrianjohnson at verizon.net
Fri Nov 1 15:01:49 CDT 2013


 Generally computer time works like this.

A tick that starts at zero when the machine is booted. This tick may be updated by a hardware interrupt at microsecond, millisecond, or in the DOS case 18.25 times per second rate. This usually never changes because it is used for hardware time-outs and changing it might make perfectly good hardware time-out ahead of time.

A number which is the divisor to obtain seconds from the timer tick. This divisor may be adjusted dynamically so the system time tracks wall-clock time.

A number that defines what to add or subtract from that number. This gets adjusted typically to GMT. to get a value of type time_t (accessible for software's time). Uncorrected, this number will be the number of seconds since the birth-date of the OS, relative to GMT.
 
These numbers do not change with a time-zone or DST/EST change. Instead, a TZ variable is used by the runtime library to tell software how to interpret the system's clock when it is __printed__!  If software is designed to use this __text__ to do something it is terribly broken. It should use the time variable, which will only change very slowly to keep sync with NIST or whatever timeserver you are using.

Remember the year 2000 fiasco when everyone was claiming that all the compuers would crash, all the mortgages would come due, all the credit cards would be maxed-out from interest charges, etc? Nothing happened. Very old computers which were not designed to handle the year 2000 simply printed a funny charcter instead of the '2' . Old DOS machines could have their time set properly, they would just not preserve it between boots because the CMOS "century byte" was not used in old BIOS.

 Cheers,
Richard B. Johnson
http://www.AbominableFirebug.com
 
On 11/01/13, Jeff Carter<broadcast at hidden-valley.com> wrote:

In Atlanta about ten years ago there was a cell tower next to
Hartsfield that kept setting my cellphone time wrong after a DST
switch. They didn't fix it for two weeks



More information about the Broadcast mailing list