aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2007-03-17 17:41:19 +0000
committerChong Yidong2007-03-17 17:41:19 +0000
commit16e5f96165395a15e98efb986cd5e842bf283e50 (patch)
treee1eed83d604176dc9daa369b7fcb0ada3b60aacd
parentdcbccc4db53a359c856545986af86dea83d8a06b (diff)
downloademacs-16e5f96165395a15e98efb986cd5e842bf283e50.tar.gz
emacs-16e5f96165395a15e98efb986cd5e842bf283e50.zip
(math-std-daylight-savings): Switch to new North American rule.
-rw-r--r--lisp/calc/calc-forms.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index 00c43af7c59..1b4b6fea94a 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -1312,20 +1312,20 @@
1312 (calcFunc-unixtime (calcFunc-unixtime date z1) z2))) 1312 (calcFunc-unixtime (calcFunc-unixtime date z1) z2)))
1313 1313
1314(defun math-std-daylight-savings (date dt zone bump) 1314(defun math-std-daylight-savings (date dt zone bump)
1315 "Standard North American daylight savings algorithm. 1315 "Standard North American daylight saving algorithm.
1316This implements the rules for the U.S. and Canada as of 1987. 1316This implements the rules for the U.S. and Canada as of 2007.
1317Daylight savings begins on the first Sunday of April at 2 a.m., 1317Daylight saving begins on the second Sunday of March at 2 a.m.,
1318and ends on the last Sunday of October at 2 a.m." 1318and ends on the first Sunday of November at 2 a.m."
1319 (cond ((< (nth 1 dt) 4) 0) 1319 (cond ((< (nth 1 dt) 3) 0)
1320 ((= (nth 1 dt) 4) 1320 ((= (nth 1 dt) 3)
1321 (let ((sunday (math-prev-weekday-in-month date dt 7 0))) 1321 (let ((sunday (math-prev-weekday-in-month date dt 14 0)))
1322 (cond ((< (nth 2 dt) sunday) 0) 1322 (cond ((< (nth 2 dt) sunday) 0)
1323 ((= (nth 2 dt) sunday) 1323 ((= (nth 2 dt) sunday)
1324 (if (>= (nth 3 dt) (+ 3 bump)) -1 0)) 1324 (if (>= (nth 3 dt) (+ 3 bump)) -1 0))
1325 (t -1)))) 1325 (t -1))))
1326 ((< (nth 1 dt) 10) -1) 1326 ((< (nth 1 dt) 11) -1)
1327 ((= (nth 1 dt) 10) 1327 ((= (nth 1 dt) 11)
1328 (let ((sunday (math-prev-weekday-in-month date dt 31 0))) 1328 (let ((sunday (math-prev-weekday-in-month date dt 7 0)))
1329 (cond ((< (nth 2 dt) sunday) -1) 1329 (cond ((< (nth 2 dt) sunday) -1)
1330 ((= (nth 2 dt) sunday) 1330 ((= (nth 2 dt) sunday)
1331 (if (>= (nth 3 dt) (+ 2 bump)) 0 -1)) 1331 (if (>= (nth 3 dt) (+ 2 bump)) 0 -1))