summaryrefslogtreecommitdiff
path: root/lisp/arc-mode.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-12-19 12:57:25 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2018-12-19 13:01:42 -0800
commit5bd6074415e8d572931ee51112d9b70b70e2ba55 (patch)
tree197616a9cf72bd188a9201274f0840afac93fac2 /lisp/arc-mode.el
parent3fa8bdca88153ff442ca22d8c298525c1b716e7e (diff)
downloademacs-5bd6074415e8d572931ee51112d9b70b70e2ba55.tar.gz
Minor fixes/simplifications to time functions
* doc/lispintro/emacs-lisp-intro.texi (Files List): Simplify. * doc/lispref/os.texi (Time of Day): Mention format-time-string as an alternative to current-time-string. * lisp/arc-mode.el (archive-unixdate, archive-unixtime): Port better to future versions of Emacs where (COUNT . HZ) will take precedence to (HI . LO). * lisp/arc-mode.el (archive-unixtime): * lisp/calendar/todo-mode.el (todo-insert-item--basic) (todo-item-done, todo-read-time): Prefer format-time-string to substringing current-time-string. * lisp/calc/calc-forms.el (calc-time, calcFunc-now): Prefer decode-time to parsing the output of current-time-string. * lisp/emacs-lisp/cl-extra.el (cl--random-time): Prefer encode-time to hashing the output of current-time-string. * lisp/gnus/gnus-score.el (gnus-score-headers) (gnus-score-adaptive): Avoid stringifying and then reparsing timestamp. * src/timefns.c (Fencode_time): Omit redundant assignment.
Diffstat (limited to 'lisp/arc-mode.el')
-rw-r--r--lisp/arc-mode.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 068702bc71b..9d63a2a579a 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -637,7 +637,7 @@ the mode is invalid. If ERROR is nil then nil will be returned."
(defun archive-unixdate (low high)
"Stringify Unix (LOW HIGH) date."
- (let* ((time (cons high low))
+ (let* ((time (list high low))
(str (current-time-string time)))
(format "%s-%s-%s"
(substring str 8 10)
@@ -646,8 +646,7 @@ the mode is invalid. If ERROR is nil then nil will be returned."
(defun archive-unixtime (low high)
"Stringify Unix (LOW HIGH) time."
- (let ((str (current-time-string (cons high low))))
- (substring str 11 19)))
+ (format-time-string "%H:%M:%S" (list high low)))
(defun archive-get-lineno ()
(if (>= (point) archive-file-list-start)