diff options
| author | Paul Eggert | 2018-12-19 12:57:25 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-12-19 13:01:42 -0800 |
| commit | 5bd6074415e8d572931ee51112d9b70b70e2ba55 (patch) | |
| tree | 197616a9cf72bd188a9201274f0840afac93fac2 /doc | |
| parent | 3fa8bdca88153ff442ca22d8c298525c1b716e7e (diff) | |
| download | emacs-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.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 7 |
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 | |||
| 1313 | string. The format does not vary for the initial part of the string, | 1313 | string. The format does not vary for the initial part of the string, |
| 1314 | which contains the day of week, month, day of month, and time of day | 1314 | which contains the day of week, month, day of month, and time of day |
| 1315 | in that order: the number of characters used for these fields is | 1315 | in that order: the number of characters used for these fields is |
| 1316 | always the same, so you can reliably | 1316 | always the same, although (unless you require English weekday or |
| 1317 | use @code{substring} to extract them. You should count | 1317 | month abbreviations regardless of locale) it is typically more |
| 1318 | characters from the beginning of the string rather than from the end, | 1318 | convenient to use @code{format-time-string} than to extract |
| 1319 | fields from the output of @code{current-time-string}, | ||
| 1319 | as the year might not have exactly four digits, and additional | 1320 | as the year might not have exactly four digits, and additional |
| 1320 | information may some day be added at the end. | 1321 | information may some day be added at the end. |
| 1321 | 1322 | ||