summaryrefslogtreecommitdiff
path: root/lisp/calendar
diff options
context:
space:
mode:
authorEdward M. Reingold <reingold@emr.cs.iit.edu>1995-12-05 22:55:22 +0000
committerEdward M. Reingold <reingold@emr.cs.iit.edu>1995-12-05 22:55:22 +0000
commit021edd45dcde128c94e068df8e24935c21458437 (patch)
treefbb758560aaebf68ea1d3dab2fd934fceee73642 /lisp/calendar
parentd613bdc034a53905357ffe199e352acaa387651a (diff)
downloademacs-021edd45dcde128c94e068df8e24935c21458437.tar.gz
Fixed dst-in-effect for southern hemisphere. Also made doc string clearer.
Diffstat (limited to 'lisp/calendar')
-rw-r--r--lisp/calendar/cal-dst.el23
1 files changed, 11 insertions, 12 deletions
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 598af905d99..78bb3c12721 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -332,27 +332,26 @@ If the locale never uses daylight savings time, set this to nil.")
(defun dst-in-effect (date)
"True if on absolute DATE daylight savings time is in effect.
-Fractional part of DATE is time of day."
+Fractional part of DATE is local standard time of day."
(let* ((year (extract-calendar-year
(calendar-gregorian-from-absolute (floor date))))
- (dst-starts (and (eval calendar-daylight-savings-starts)
+ (dst-starts-gregorian (eval calendar-daylight-savings-starts))
+ (dst-ends-gregorian (eval calendar-daylight-savings-ends))
+ (dst-starts (and dst-starts-gregorian
(+ (calendar-absolute-from-gregorian
- (eval calendar-daylight-savings-starts))
+ dst-starts-gregorian)
(/ calendar-daylight-savings-starts-time
60.0 24.0))))
- (dst-ends (and (eval calendar-daylight-savings-ends)
+ (dst-ends (and dst-ends-gregorian
(+ (calendar-absolute-from-gregorian
- (eval calendar-daylight-savings-ends))
+ dst-ends-gregorian)
(/ (- calendar-daylight-savings-ends-time
calendar-daylight-time-offset)
60.0 24.0)))))
- (and (and dst-starts dst-ends
- (or (and (< dst-starts dst-ends);; northern hemi.
- (<= dst-starts date) (< date dst-ends))
- (and (< dst-ends dst-starts);; southern hemi.
- (<= dst-starts date) (< date dst-ends))
- (and dst-starts (not dst-ends) (<= dst-starts date))
- (and dst-ends (not dst-starts) (< date dst-ends)))))))
+ (and dst-starts dst-ends
+ (if (< dst-starts dst-ends)
+ (and (<= dst-starts date) (< date dst-ends))
+ (or (<= dst-starts date) (< date dst-ends))))))
(defun dst-adjust-time (date time &optional style)
"Adjust, to account for dst on DATE, decimal fraction standard TIME.