Function: icalendar-recur-tz-decode-time
icalendar-recur-tz-decode-time is a byte-compiled function defined in
icalendar-recur.el.gz.
Signature
(icalendar-recur-tz-decode-time TS VTIMEZONE)
Documentation
Decode Lisp timestamp TS with the appropriate offset in VTIMEZONE.
VTIMEZONE should be an icalendar-vtimezone component node. The correct
observance for TS will be looked up in VTIMEZONE, TS will be decoded
with the UTC offset of that observance, and its dst slot will be set
based on whether the observance is an icalendar-standard or
icalendar-daylight component. If VTIMEZONE does not have an
observance that applies to TS, it is decoded into UTC time.
VTIMEZONE may also be an icalendar-utc-offset. In this case TS is
decoded directly into this UTC offset, and its dst slot is set to -1.
If VTIMEZONE is t, TS is decoded to UTC time.
Other relevant functions are documented in the icalendar group.
Shortdoc
;; icalendar
(icalendar-recur-tz-decode-time timestamp vtimezone)
e.g. => (0 0 11 11 11 2024 1 nil 3600)
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/icalendar-recur.el.gz
(defun icr:tz-decode-time (ts vtimezone)
"Decode Lisp timestamp TS with the appropriate offset in VTIMEZONE.
VTIMEZONE should be an `icalendar-vtimezone' component node. The correct
observance for TS will be looked up in VTIMEZONE, TS will be decoded
with the UTC offset of that observance, and its dst slot will be set
based on whether the observance is an `icalendar-standard' or
`icalendar-daylight' component. If VTIMEZONE does not have an
observance that applies to TS, it is decoded into UTC time.
VTIMEZONE may also be an `icalendar-utc-offset'. In this case TS is
decoded directly into this UTC offset, and its dst slot is set to -1.
If VTIMEZONE is t, TS is decoded to UTC time."
(let* ((observance (when (ical:vtimezone-component-p vtimezone)
(car (icr:tz-observance-on ts vtimezone))))
(offset (cond (observance (icr:tz-offset-in observance))
((cl-typep vtimezone 'ical:utc-offset)
vtimezone)
(t t)))) ; decode to UTC
(ical:date-time-variant ; ensures weekday gets set, too
(decode-time ts offset)
:zone offset
:dst (cond (observance (ical:daylight-component-p observance))
((eq t vtimezone) nil) ; UTC
(t -1)))))