aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-03 23:27:01 +0000
committerRichard M. Stallman1996-09-03 23:27:01 +0000
commitd839637129b42f2aa4668fe84e525d8fa6d31695 (patch)
treef120d24b650f0d82ad52927cde1592a46ac4bfdf
parent1fff30af6cd2df77f795f026e90ab85d18c7afbf (diff)
downloademacs-d839637129b42f2aa4668fe84e525d8fa6d31695.tar.gz
emacs-d839637129b42f2aa4668fe84e525d8fa6d31695.zip
(calendar-current-date): Simplify by using decode-time instead
of parsing current-time-string.
-rw-r--r--lisp/calendar/calendar.el8
1 files 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."
1938 1938
1939(defun calendar-current-date () 1939(defun calendar-current-date ()
1940 "Returns the current date in a list (month day year)." 1940 "Returns the current date in a list (month day year)."
1941 (let ((s (current-time-string))) 1941 (let ((now (decode-time)))
1942 (list (length (member (substring s 4 7) 1942 (list (nth 4 now) (nth 3 now) (nth 5 now))))
1943 '("Dec" "Nov" "Oct" "Sep" "Aug" "Jul"
1944 "Jun" "May" "Apr" "Mar" "Feb" "Jan")))
1945 (string-to-number (substring s 8 10))
1946 (string-to-number (substring s 20 24)))))
1947 1943
1948(defun calendar-cursor-to-date (&optional error) 1944(defun calendar-cursor-to-date (&optional error)
1949 "Returns a list (month day year) of current cursor position. 1945 "Returns a list (month day year) of current cursor position.