[comp.sys.handhelds] Daylight Savings Time transitions

edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) (11/20/90)

A while ago, I posted modified versions of James H. Cloos' alarms for Daylight
Savings/Standard Time transitions.  Since then, one of the dates has passed. 
The alarms were originally presented as two lists to pass to STOALARM.  Anybody
using those lists now would set a past-due alarm. 

Here is a program that calculates the next dates and sets the alarms
appropriately.  Once set, the alarms repeat themselves.  These use the current
United States scheme -- last Sunday in November, first in April.

The program is:
 
%%HP: T(3)A(R)F(.);
\<< { 28.10199 2
  \<< DUP RCLALARM
SWAP DELALARM 1
11.11 -11 DATE+
.000001 + DUP
1.01195 DDAYS -7
MOD DATE+ PUT
STOALARM DROP 
-29491200 CLKADJ
OFF
  \>> 0 } 11.11 -11
DATE+ -7 { 7.041991
2
  \<< DUP RCLALARM
SWAP DELALARM 1
4.04 -3 DATE+
.000001 + DUP
1.01195 DDAYS 7 MOD
DATE+ PUT STOALARM
DROP
29491200 CLKADJ
OFF
  \>> 0 } 4.04 -3
DATE+ 7 0 1
  START \-> D M
    \<< 1 D DUP
1.01195 DDAYS M MOD
DATE+
      IF DUP DATE
DDAYS 0 \>=
      THEN DROP D
.000001 + DUP
1.01195 DDAYS M MOD
DATE+
      END PUT
STOALARM DROP
    \>>
  NEXT
\>>
 
To use these routines with the clock adjustment routines I posted previously,
change "29491200 CLKADJ" to "PATH HOME [path to time directory] 1_h ADJT
EVAL", and use -1_h for the negative adjustment. 
 
 
				-- edp (Eric Postpischil)
				"Always mount a scratch monkey."
				edp@jareth.enet.dec.com