Ignore:
Timestamp:
11/09/15 10:59:10 (6 years ago)
Author:
Mark Evenson
Message:

{decode,encode}-universal-time "time of the time" timezone semantics

Scott L. Burson

The implementation of EXT:GET-TIME-ZONE provides the underlying
mechanism.

Both GET-TIME-ZONE and DEFAULT-TIME-ZONE have been elevated to
supported status by virtue of promotion of their respective symbols to
the EXTENSIONS and SYSTEM packages, respectively.

ME: A mechanism for adding symbols to both SYS and EXT packages with
DEFINE-SYMBOL-MACRO didn't work, but left as comment at the end of
'time.lisp' for further work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/time.lisp

    r11391 r14840  
    4343(defconstant weekday-november-17-1858 2)
    4444
     45
     46
    4547;;; decode-universal-time universal-time &optional time-zone
    4648;;; => second minute hour date month year day daylight-p zone
     
    5456        (setf seconds-west (* time-zone 3600)
    5557              daylight nil)
    56         (multiple-value-bind (time-zone daylight-p) (default-time-zone)
     58        (multiple-value-bind (time-zone daylight-p) (ext:get-time-zone universal-time)
    5759          (setf seconds-west (* time-zone 3600)
    5860                daylight daylight-p)))
     
    128130   (hours (+ hour (* days 24))))
    129131    (cond (time-zone
    130            (+ second (* (+ minute (* (+ hours time-zone) 60)) 60)))
     132           (let* ((tz-guess (get-time-zone (* hours 3600)))
     133      (guess (+ second (* 60 (+ minute (* 60 (+ hours tz-guess))))))
     134      (tz (get-time-zone guess)))
     135             (+ guess (* 3600 (- tz tz-guess)))))
    131136          ((> year 2037)
    132137           (labels ((leap-year-p (year)
     
    144149          (t
    145150           (+ second (* (+ minute (* (+ hours (default-time-zone)) 60)) 60))))))
     151
     152#|
     153(intern "GET-TIME-ZONE" (find-package :ext))
     154(define-symbol-macro EXT:GET-TIME-ZONE
     155    `(get-time-zone))
     156(export (intern "GET-TIME-ZONE" (find-package :ext)))
     157#|
Note: See TracChangeset for help on using the changeset viewer.