本質decode-universal-time
是Common Lisp的功能。這些不一定在emacs-lisp中可用。在本地emacs中快速檢查表明這是事實。
一些接近你原來的實現將是:
(defun org-day-of-week (year month day)
(nth 6
(decode-time
(date-to-time
(format "%d-%02d-%02dT00:00:00" year month day)))))
你應該能夠(也許與date-to-time
一起選擇)使用decode-time
代替:
decode-time is a built-in function in `C source code'. (decode-time &optional specified-time) Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW DST ZONE). The optional specified-time should be a list of (HIGH LOW . IGNORED), as from `current-time' and `file-attributes', or nil to use the current time. The obsolete form (HIGH . LOW) is also still accepted. The list has the following nine members: SEC is an integer between 0 and 60; SEC is 60 for a leap second, which only some operating systems support. MINUTE is an integer between 0 and 59. HOUR is an integer between 0 and 23. DAY is an integer between 1 and 31. MONTH is an integer between 1 and 12. YEAR is an integer indicating the four-digit year. DOW is the day of week, an integer between 0 and 6, where 0 is Sunday. DST is t if daylight saving time is in effect, otherwise nil. ZONE is an integer indicating the number of seconds east of Greenwich. (Note that Common Lisp has different meanings for DOW and ZONE.)