X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/732fd4c7e11debd61c97eaaba3038d61e6ec7024..05d76dba6604f78e4b2b7b9f8b30c916cad7d32a:/lisp/timezone.el diff --git a/lisp/timezone.el b/lisp/timezone.el index 0f3ac1e3e5..1ff3f8a822 100644 --- a/lisp/timezone.el +++ b/lisp/timezone.el @@ -1,6 +1,6 @@ ;;; timezone.el --- time zone package for GNU Emacs -;; Copyright (C) 1990-1993, 1996, 1999, 2001-2015 Free Software +;; Copyright (C) 1990-1993, 1996, 1999, 2001-2016 Free Software ;; Foundation, Inc. ;; Author: Masanobu Umeda @@ -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.