From: Richard M. Stallman Date: Tue, 3 Sep 1996 23:27:01 +0000 (+0000) Subject: (calendar-current-date): Simplify by using decode-time instead X-Git-Tag: emacs-20.1~3845 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d839637129b42f2aa4668fe84e525d8fa6d31695;p=emacs.git (calendar-current-date): Simplify by using decode-time instead of parsing current-time-string. --- diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 6cffe388003..bd3d58fe48f 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1938,12 +1938,8 @@ the STRINGS are just concatenated and the result truncated." (defun calendar-current-date () "Returns the current date in a list (month day year)." - (let ((s (current-time-string))) - (list (length (member (substring s 4 7) - '("Dec" "Nov" "Oct" "Sep" "Aug" "Jul" - "Jun" "May" "Apr" "Mar" "Feb" "Jan"))) - (string-to-number (substring s 8 10)) - (string-to-number (substring s 20 24))))) + (let ((now (decode-time))) + (list (nth 4 now) (nth 3 now) (nth 5 now)))) (defun calendar-cursor-to-date (&optional error) "Returns a list (month day year) of current cursor position.