Function: icalendar-make-date-time
icalendar-make-date-time is a byte-compiled function defined in
icalendar-utils.el.gz.
Signature
(icalendar-make-date-time &key SECOND MINUTE HOUR DAY MONTH YEAR (DST -1 GIVEN-DST) ZONE TZ)
Documentation
Make an icalendar-date-time from the given keyword arguments.
This function is like make-decoded-time, except that it automatically
sets the weekday slot set based on the date arguments, and it accepts an
additional keyword argument: :tz. If provided, its value should be an
icalendar-vtimezone, and the :zone and :dst arguments should not
be provided. In this case, the zone and dst slots in the returned
date-time will be adjusted to the correct values in the given time zone
for the local time represented by the remaining arguments.
Other relevant functions are documented in the icalendar group.
Shortdoc
;; icalendar
(icalendar-make-date-time :year 2024 :month 12 :day 11
:hour 10 :minute 0 :second 0
:tz vtimezone)
e.g. => (0 0 10 11 12 2024 3 -1 3600)
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/icalendar-utils.el.gz
(cl-defun ical:make-date-time (&key second minute hour day month year
(dst -1 given-dst) zone tz)
"Make an `icalendar-date-time' from the given keyword arguments.
This function is like `make-decoded-time', except that it automatically
sets the weekday slot set based on the date arguments, and it accepts an
additional keyword argument: `:tz'. If provided, its value should be an
`icalendar-vtimezone', and the `:zone' and `:dst' arguments should not
be provided. In this case, the zone and dst slots in the returned
date-time will be adjusted to the correct values in the given time zone
for the local time represented by the remaining arguments."
(when (and tz (or zone given-dst))
(error "Possibly conflicting time zone data in args"))
(apply #'ical:date-time-variant (make-decoded-time)
`(:second ,second :minute ,minute :hour ,hour
:day ,day :month ,month :year ,year
;; Don't pass these keywords unless they were given explicitly.
;; TODO: is there a cleaner way to write this?
,@(when tz (list :tz tz))
,@(when given-dst (list :dst dst))
,@(when zone (list :zone zone)))))