diff options
Diffstat (limited to 'lisp/timezone.el')
-rw-r--r-- | lisp/timezone.el | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lisp/timezone.el b/lisp/timezone.el index 0f3ac1e3e5e..284da2139da 100644 --- a/lisp/timezone.el +++ b/lisp/timezone.el @@ -295,13 +295,9 @@ Gregorian date Sunday, December 31, 1 BC." ;; (timezone-absolute-from-gregorian 1 1 1970) (days (- date current-time-origin)) (seconds-per-day (float 86400)) - (seconds (+ seconds (* days seconds-per-day))) - (current-time-arithmetic-base (float 65536)) - (hi (floor (/ seconds current-time-arithmetic-base))) - (hibase (* hi current-time-arithmetic-base)) - (lo (floor (- seconds hibase)))) - (and (< (abs (- seconds (+ hibase lo))) 2) ;; Check for integer overflow. - (cons hi lo)))) + (day-seconds (* days seconds-per-day))) + (condition-case nil (time-add day-seconds seconds) + (range-error)))) (defun timezone-time-zone-from-absolute (date seconds) "Compute the local time zone for DATE at time SECONDS after midnight. |