在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)
(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)
| 归档时间: |
|
| 查看次数: |
347 次 |
| 最近记录: |