Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!piglet!madler From: madler@piglet.caltech.edu (Mark Adler) Newsgroups: comp.sys.next Subject: Re: Daylight savings time Message-ID: <1990Oct30.070713.14635@nntp-server.caltech.edu> Date: 30 Oct 90 07:07:13 GMT References: <1990Oct29.192654.28687@nntp-server.caltech.edu> Sender: news@nntp-server.caltech.edu Organization: California Institute of Technology, Pasadena Lines: 24 Nntp-Posting-Host: piglet.caltech.edu Someone asked me what algorithm the NeXT uses to determine when to change from or to daylight savings time. I sent him a "dunno" reply, but since found the answer: it doesn't have an algorithm. There is a file (/etc/zoneinfo/localtime) that contains a list of local time changes. For Pacific time, the changes cover from 1918 to 2037. One can even see a little bit of history in the data. Daylight Savings Time was tried in 1918 and 1919 and then apparently dropped. Then daylight savings time (actually called PWT instead of PDT) was in effect continuously from Feb 1942 through Sep 1945. Guess what the "W" stands for. Then, daylight savings time was instituted on a regular basis starting in 1967. There does appear to be an algorithm extractable from the data (at least from 1967 on)---change to PDT on the first Sunday of April at 3 a.m., and change to PST on the last Sunday of October at 1 a.m. This appears to apply to Mountain, Central, Eastern, and Yukon as well. Arizona, Hawaii, and East Indiana (?) don't have daylight savings time. I could mention that Canada changes instead on Saturday night at 10 p.m., or that Singapore doesn't change at all, but I won't. Mark Adler madler@piglet.caltech.edu