X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/233ba4d924933cb56129bd7511e6137b7c0b8e3e..f315b69922db769f3358e15616aa76c965be8a89:/lisp/timezone.el diff --git a/lisp/timezone.el b/lisp/timezone.el index 092d491a49..8ff43966f6 100644 --- a/lisp/timezone.el +++ b/lisp/timezone.el @@ -1,7 +1,7 @@ ;;; timezone.el --- time zone package for GNU Emacs -;; Copyright (C) 1990-1993, 1996, 1999, 2001-2011 -;; Free Software Foundation, Inc. +;; Copyright (C) 1990-1993, 1996, 1999, 2001-2014 Free Software +;; Foundation, Inc. ;; Author: Masanobu Umeda ;; Maintainer: umerin@mse.kyutech.ac.jp @@ -51,7 +51,7 @@ ("GMT-4" . -400) ("GMT-5" . -500) ("GMT-6" . -600) ("GMT-7" . -700) ("GMT-8" . -800) ("GMT-9" . -900) ("GMT-10" . -1000) ("GMT-11" . -1100) ("GMT-12" . -1200)) - "*Time differentials of timezone from GMT in +-HHMM form. + "Time differentials of timezone from GMT in +-HHMM form. This list is obsolescent, and is present only for backwards compatibility, because time zone names are ambiguous in practice. Use `current-time-zone' instead.") @@ -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.