;;; 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
("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.")
;; (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.