How does Daylight Saving Time work on a computer?
The MC146818 real-time clock chip, as used in the IBM PC/AT, indeed had the capability to make DST changes on its own. It only worked correctly in the United State and even then only worked correctly for a mere three years until the law was changed, and the DST rule that was hardwired into the chip circuitry no longer matched the actual DST rule. This capability to update DST in hardware hasn't been used in decades.
If your operating system is a DOS Think operating system, then yes the DST changes are applied to the real-time clock by the operating system, and thus only when the machine is fully powered on and bootstrapped into the operating system. However, this system has been known to be seriously and fundamentally broken for almost as long. It has been discussed thoroughly in on-line discussion fora since the 1980s.
Unices and UNIX-like operating systems run the hardware RTC in UTC, and never apply any DST changes to it. In fact, there isn't even any knowledge of DST in the operating system kernel. The
kernel and the hardware operate in UTC all of the time and a system library function applies a conversion from UTC to the local standard time/daylight-savings time based upon the TZ environment variable and an extensive on-disc timezone database. There isn't a switchover between standard and daylight-savings time per se. The conversion function simply yields the correct local time offset according to the time being converted.
Yes, the BSDs and Linux can be made to run in the DOS Think fashion, with the hardware clock running in something other than UTC. This isn't a particularly good idea, and there's a lot of additional fragile mechanism that comes along with it. For example, system managers such as systemd have to ensure that they have told the kernel about local time before fsck runs, because otherwise people in timezones that are ahead of UTC experience odd behaviour caused by the system clock going backwards during system startup.
- Jonathan de Boyne Pollard (2009). The DOS Think way of keeping time is fundamentally broken. . Frequently Given Answers.
- Andrey A. Chernov (2012-03-08). adjkerntz. FreeBSD 9.2 manual pages.
Category: Personal Finance