/[emacs]/emacs/lisp/calendar/cal-dst.el
ViewVC logotype

Diff of /emacs/lisp/calendar/cal-dst.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by miles, Mon Sep 1 15:45:19 2003 UTC revision 1.21 by teirllm, Wed Jul 14 23:22:14 2004 UTC
# Line 70  absolute date ABS-DATE is the equivalent Line 70  absolute date ABS-DATE is the equivalent
70  (defun calendar-time-from-absolute (abs-date s)  (defun calendar-time-from-absolute (abs-date s)
71    "Time of absolute date ABS-DATE, S seconds after midnight.    "Time of absolute date ABS-DATE, S seconds after midnight.
72    
73  Returns the pair (HIGH . LOW) where HIGH and LOW are the high and low  Returns the list (HIGH LOW) where HIGH and LOW are the high and low
74  16 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC,  16 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC,
75  ignoring leap seconds, that is the equivalent moment to S seconds after  ignoring leap seconds, that is the equivalent moment to S seconds after
76  midnight UTC on absolute date ABS-DATE."  midnight UTC on absolute date ABS-DATE."
77    (let* ((a (- abs-date calendar-system-time-basis))    (let* ((a (- abs-date calendar-system-time-basis))
78           (u (+ (* 163 (mod a 512)) (floor s 128))))           (u (+ (* 163 (mod a 512)) (floor s 128))))
79      ;; Overflow is a terrible thing!      ;; Overflow is a terrible thing!
80      (cons      (list
81       ;; floor((60*60*24*a + s) / 2^16)       ;; floor((60*60*24*a + s) / 2^16)
82       (+ a (* 163 (floor a 512)) (floor u 512))       (+ a (* 163 (floor a 512)) (floor u 512))
83       ;; (60*60*24*a + s) mod 2^16       ;; (60*60*24*a + s) mod 2^16

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26