aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward M. Reingold1995-12-05 22:55:22 +0000
committerEdward M. Reingold1995-12-05 22:55:22 +0000
commit021edd45dcde128c94e068df8e24935c21458437 (patch)
treefbb758560aaebf68ea1d3dab2fd934fceee73642
parentd613bdc034a53905357ffe199e352acaa387651a (diff)
downloademacs-021edd45dcde128c94e068df8e24935c21458437.tar.gz
emacs-021edd45dcde128c94e068df8e24935c21458437.zip
Fixed dst-in-effect for southern hemisphere. Also made doc string clearer.
-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.")
332 332
333(defun dst-in-effect (date) 333(defun dst-in-effect (date)
334 "True if on absolute DATE daylight savings time is in effect. 334 "True if on absolute DATE daylight savings time is in effect.
335Fractional part of DATE is time of day." 335Fractional part of DATE is local standard time of day."
336 (let* ((year (extract-calendar-year 336 (let* ((year (extract-calendar-year
337 (calendar-gregorian-from-absolute (floor date)))) 337 (calendar-gregorian-from-absolute (floor date))))
338 (dst-starts (and (eval calendar-daylight-savings-starts) 338 (dst-starts-gregorian (eval calendar-daylight-savings-starts))
339 (dst-ends-gregorian (eval calendar-daylight-savings-ends))
340 (dst-starts (and dst-starts-gregorian
339 (+ (calendar-absolute-from-gregorian 341 (+ (calendar-absolute-from-gregorian
340 (eval calendar-daylight-savings-starts)) 342 dst-starts-gregorian)
341 (/ calendar-daylight-savings-starts-time 343 (/ calendar-daylight-savings-starts-time
342 60.0 24.0)))) 344 60.0 24.0))))
343 (dst-ends (and (eval calendar-daylight-savings-ends) 345 (dst-ends (and dst-ends-gregorian
344 (+ (calendar-absolute-from-gregorian 346 (+ (calendar-absolute-from-gregorian
345 (eval calendar-daylight-savings-ends)) 347 dst-ends-gregorian)
346 (/ (- calendar-daylight-savings-ends-time 348 (/ (- calendar-daylight-savings-ends-time
347 calendar-daylight-time-offset) 349 calendar-daylight-time-offset)
348 60.0 24.0))))) 350 60.0 24.0)))))
349 (and (and dst-starts dst-ends 351 (and dst-starts dst-ends
350 (or (and (< dst-starts dst-ends);; northern hemi. 352 (if (< dst-starts dst-ends)
351 (<= dst-starts date) (< date dst-ends)) 353 (and (<= dst-starts date) (< date dst-ends))
352 (and (< dst-ends dst-starts);; southern hemi. 354 (or (<= dst-starts date) (< date dst-ends))))))
353 (<= dst-starts date) (< date dst-ends))
354 (and dst-starts (not dst-ends) (<= dst-starts date))
355 (and dst-ends (not dst-starts) (< date dst-ends)))))))
356 355
357(defun dst-adjust-time (date time &optional style) 356(defun dst-adjust-time (date time &optional style)
358 "Adjust, to account for dst on DATE, decimal fraction standard TIME. 357 "Adjust, to account for dst on DATE, decimal fraction standard TIME.