(defun calc-time ()
(interactive)
(calc-wrapper
- (let ((time (decode-time)))
+ (let ((time (decode-time nil nil 'integer))) ;; FIXME: Support subseconds.
(calc-enter-result 0 "time"
(list 'mod
(list 'hms
(math-add (math-float date)
(math-div (math-add (+ (* (nth 3 dt) 3600)
(* (nth 4 dt) 60))
- (nth 5 dt))
+ ;; FIXME: Support subseconds.
+ (time-convert (nth 5 dt) 'integer))
'(float 864 2)))
date)))
(math-parse-iso-date-validate isoyear isoweek isoweekday hour minute second)))))
(defun calcFunc-now (&optional zone)
- (let ((date (let ((now (decode-time)))
+ ;; FIXME: Support subseconds.
+ (let ((date (let ((now (decode-time nil nil 'integer)))
(list 'date (math-dt-to-date
(list (decoded-time-year now)
(decoded-time-month now)
(when (> (length isodatetimestring) 14)
;; seconds present
(setq second (read (substring isodatetimestring 13 15))))
+ ;; FIXME: Support subseconds.
(when (and (> (length isodatetimestring) 15)
;; UTC specifier present
(char-equal ?Z (aref isodatetimestring 15)))
(setq minutes (read (substring isodurationstring
(match-beginning 10)
(match-end 10)))))
+ ;; FIXME: Support subseconds.
(if (match-beginning 11)
(setq seconds (read (substring isodurationstring
(match-beginning 12)
"Add TIME1 to TIME2.
Both times must be given in decoded form. One of these times must be
valid (year > 1900 or something)."
- ;; FIXME: does this function exist already?
+ ;; FIXME: does this function exist already? Can we use decoded-time-add?
(decode-time (encode-time
- (+ (decoded-time-second time1) (decoded-time-second time2))
+ ;; FIXME: Support subseconds.
+ (time-convert (time-add (decoded-time-second time1)
+ (decoded-time-second time2))
+ 'integer)
(+ (decoded-time-minute time1) (decoded-time-minute time2))
(+ (decoded-time-hour time1) (decoded-time-hour time2))
(+ (decoded-time-day time1) (decoded-time-day time2))
duration))))
(list start end
(or duration
+ ;; FIXME: Support subseconds.
(decode-time (time-subtract (iso8601--encode-time end)
(iso8601--encode-time start))
- (or (decoded-time-zone end) 0))))))
+ (or (decoded-time-zone end) 0) 'integer)))))
(defun iso8601--match (regexp string)
(string-match (concat "\\`" regexp "\\'") string))
(setq hour (string-to-number (match-string 1 delay))
minute (string-to-number (match-string 2 delay)))
;; Use current time, except...
- (setq deadline (decode-time))
+ (setq deadline (decode-time nil nil t))
;; ... for minute and hour.
(setq deadline (apply #'encode-time (car deadline) minute hour
(nthcdr 3 deadline)))
;; the full date if it's older)
(defun gnus-seconds-today ()
- "Return the number of seconds passed today."
- (let ((now (decode-time)))
+ "Return the integer number of seconds passed today."
+ (let ((now (decode-time nil nil 'integer)))
(+ (decoded-time-second now)
(* (decoded-time-minute now) 60)
(* (decoded-time-hour now) 3600))))
(defun gnus-seconds-month ()
- "Return the number of seconds passed this month."
- (let ((now (decode-time)))
+ "Return the integer number of seconds passed this month."
+ (let ((now (decode-time nil nil 'integer)))
(+ (decoded-time-second now)
(* (decoded-time-minute now) 60)
(* (decoded-time-hour now) 3600)
(* (- (decoded-time-day now) 1) 3600 24))))
(defun gnus-seconds-year ()
- "Return the number of seconds passed this year."
+ "Return the integer number of seconds passed this year."
(let* ((current (current-time))
- (now (decode-time current))
+ (now (decode-time current nil 'integer))
(days (format-time-string "%j" current)))
(+ (decoded-time-second now)
(* (decoded-time-minute now) 60)
"Make date string for the Expires header. Expiry in DAYS days.
In posting styles use `(\"Expires\" (make-expires-date 30))'."
- (let* ((cur (decode-time))
+ (let* ((cur (decode-time nil nil 'integer))
(nday (+ days (decoded-time-day cur))))
(setf (decoded-time-day cur) nday)
(message-make-date (encode-time cur))))
:type 'hook)
(defun midnight-next ()
- "Return the number of seconds till the next midnight."
- (pcase-let ((`(,sec ,min ,hrs) (decode-time)))
+ "Return the number of whole or partial seconds till the next midnight."
+ (pcase-let ((`(,sec ,min ,hrs) (decode-time nil nil 'integer)))
(- (* 24 60 60) (* 60 60 hrs) (* 60 min) sec)))
;;;###autoload
(message "No timer set")
(let* ((rtime (decode-time
(time-subtract (timer--time org-timer-countdown-timer)
- nil)))
+ nil)
+ 'integer))
(rsecs (nth 0 rtime))
(rmins (nth 1 rtime)))
(message "%d minute(s) %d seconds left before next time out"
(decoded-time-year time)
(ediff-fill-leading-zero (decoded-time-hour time))
(ediff-fill-leading-zero (decoded-time-minute time))
- (ediff-fill-leading-zero (decoded-time-second time))))
+ (ediff-fill-leading-zero (time-convert (decoded-time-second time)
+ 'integer))))
;; Draw the directories
(defun ediff-insert-dirs-in-meta-buffer (meta-list)