aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2018-12-19 12:57:25 -0800
committerPaul Eggert2018-12-19 13:01:42 -0800
commit5bd6074415e8d572931ee51112d9b70b70e2ba55 (patch)
tree197616a9cf72bd188a9201274f0840afac93fac2 /doc
parent3fa8bdca88153ff442ca22d8c298525c1b716e7e (diff)
downloademacs-5bd6074415e8d572931ee51112d9b70b70e2ba55.tar.gz
emacs-5bd6074415e8d572931ee51112d9b70b70e2ba55.zip
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 'doc')
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi2
-rw-r--r--doc/lispref/os.texi7
2 files changed, 5 insertions, 4 deletions
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 0b0c0a167d9..1a1518b2c51 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -15599,7 +15599,7 @@ like this:
15599 (recursive-lengths-list-many-files 15599 (recursive-lengths-list-many-files
15600 (files-in-below-directory "/usr/local/src/emacs/lisp/")) 15600 (files-in-below-directory "/usr/local/src/emacs/lisp/"))
15601 '<) 15601 '<)
15602 (insert (format "%s" (current-time-string)))) 15602 (insert (current-time-string)))
15603@end ignore 15603@end ignore
15604 15604
15605@node Counting function definitions 15605@node Counting function definitions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 41753859e50..60697f2e29f 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1313,9 +1313,10 @@ This function returns the current time and date as a human-readable
1313string. The format does not vary for the initial part of the string, 1313string. The format does not vary for the initial part of the string,
1314which contains the day of week, month, day of month, and time of day 1314which contains the day of week, month, day of month, and time of day
1315in that order: the number of characters used for these fields is 1315in that order: the number of characters used for these fields is
1316always the same, so you can reliably 1316always the same, although (unless you require English weekday or
1317use @code{substring} to extract them. You should count 1317month abbreviations regardless of locale) it is typically more
1318characters from the beginning of the string rather than from the end, 1318convenient to use @code{format-time-string} than to extract
1319fields from the output of @code{current-time-string},
1319as the year might not have exactly four digits, and additional 1320as the year might not have exactly four digits, and additional
1320information may some day be added at the end. 1321information may some day be added at the end.
1321 1322