如何获得elisp时间指定的月份天数?

jus*_*nhj 2 emacs elisp date

在elisp我有一个时间(三个整数的形式),我可以使用解码时间获得月份.我想得到的是那个月(和年)的天数,使用elisp函数(而不是自己编写).

即:

(defun days-in-month-at-time(t)
    ; Figure out month and year with decode-time
    ; return number of days in that month   
)
Run Code Online (Sandbox Code Playgroud)

Tör*_*bor 6

(require 'timezone)

(defun days-in-month-at-time (time)
  "Return number of days in month at TIME."
  (let ((datetime (decode-time time)))
    (timezone-last-day-of-month (nth 4 datetime) (nth 5 datetime))))
Run Code Online (Sandbox Code Playgroud)