From d839637129b42f2aa4668fe84e525d8fa6d31695 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 3 Sep 1996 23:27:01 +0000 Subject: [PATCH] (calendar-current-date): Simplify by using decode-time instead of parsing current-time-string. --- lisp/calendar/calendar.el | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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. -- 2.39.2