From: Lars Ingebrigtsen Date: Tue, 30 Jul 2019 11:07:49 +0000 (+0200) Subject: Use decoded time accessors in time-date X-Git-Tag: emacs-27.0.90~1817^2~19 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e9e1b0af354aa1672429729ff1e0f48370ce362f;p=emacs.git Use decoded time accessors in time-date * lisp/calendar/time-date.el (time-to-days): Use decoded time accessors. --- diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index d299dc5e7d1..e195f71c58a 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -237,7 +237,7 @@ DATE1 and DATE2 should be date-time strings." TIME should be a time value. The Gregorian date Sunday, December 31, 1bce is imaginary." (let* ((tim (decode-time time)) - (year (nth 5 tim))) + (year (decoded-time-year tim))) (+ (time-date--day-in-year tim) ; Days this year (* 365 (1- year)) ; + Days in prior years (/ (1- year) 4) ; + Julian leap years