]> code.delx.au - gnu-emacs/blobdiff - lisp/timezone.el
Update copyright year to 2015
[gnu-emacs] / lisp / timezone.el
index 092d491a495af95e28b749eb346b2ccf5b8f209f..284da2139da880bfd8d4bde00c1d16fa207b1f57 100644 (file)
@@ -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-2015 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.