summaryrefslogtreecommitdiff
path: root/lisp/calendar/time-date.el
Commit message (Collapse)AuthorAge
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
|
* * lisp/calendar/time-date.el (seconds-to-time): Use the original arg listStefan Monnier2022-08-14
|
* Fix signature of `seconds-to-time'Po Lu2022-08-06
| | | | | * lisp/calendar/time-date.el (seconds-to-time): Fix after change to time-convert.
* time-convert): Deprecate calls without an explicit FORM argStefan Monnier2022-08-05
| | | | | | | | | | | * lisp/subr.el (time-convert): Deprecate calls without an explicit FORM arg. * doc/lispref/os.texi (Time Conversion): Adjust doc accordingly. * lisp/calendar/time-date.el (days-to-time): * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time): * lisp/gnus/nnrss.el (nnrss-normalize-date): * lisp/epa-ks.el (epa-ks--parse-buffer): Silence corresponding warnings.
* Simplify a few timestampsPaul Eggert2022-08-01
| | | | | | | | | | | | | | * lisp/calendar/time-date.el (safe-date-to-time): * lisp/calendar/timeclock.el (timeclock-generate-report): * lisp/epg.el (epg--start): * lisp/gnus/gnus-demon.el (gnus-demon-nntp-close-connection): * lisp/gnus/gnus-util.el (gnus-date-get-time): * lisp/gnus/nnheader.el (nnheader-last-message-time): * lisp/gnus/nnrss.el (nnrss-request-expire-articles): * lisp/vc/ediff-util.el (ediff-command-begin-time) (ediff-calc-command-time, ediff-profile): Prefer an integer like 0 to a timestamp list like (0 0) where either will do.
* * time-date.el (decoded-time-period): Rename TIME in docstringPhilip Kaludercic2022-07-11
|
* Default decoded-time dst slot to -1Paul Eggert2022-06-13
| | | | | * lisp/simple.el (decoded-time): Default dst slot to -1. Improve related doc strings.
* decoded-time-set-defaults now leaves DST alonePaul Eggert2022-05-27
| | | | | * lisp/calendar/time-date.el (decoded-time-set-defaults): Don’t mess with decoded-time-dst (Bug#55635).
* Make make-decoded-time use -1 for dst unless givenLars Ingebrigtsen2022-05-27
| | | | | * lisp/calendar/time-date.el (make-decoded-time): DST -1 is the value for "doesn't know", not nil (bug#55635).
* Fix format-seconds error in previous changeLars Ingebrigtsen2022-04-13
| | | | | * lisp/calendar/time-date.el (format-seconds): Fix zero elision when using fractional seconds.
* Make list-times not include zero elementsLars Ingebrigtsen2022-04-13
| | | | | | | | | * doc/lispref/os.texi (Time Parsing): Mention %x. * lisp/calendar/time-date.el (format-seconds): Accept a new %x spec that removes trailing zeros (bug#54904). * lisp/emacs-lisp/timer-list.el (list-timers): Don't display trailing zero bits.
* Merge from origin/emacs-28Eli Zaretskii2022-01-01
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-01
| |
* | Use time-convert in with-decoded-time-valuePaul Eggert2021-12-05
| | | | | | | | | | | | * lisp/calendar/time-date.el (with-decoded-time-value): Prefer time-convert to current-time on the off chance that code will use this obsolete macro even after current-time returns pairs.
* | Fix (date-to-time "2021-12-04")Paul Eggert2021-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should complete the fix for Bug#52209. * lisp/calendar/time-date.el (date-to-time): Apply decoded-time-set-defaults only to the output of (parse-time-string date), and only when the output has a year (to avoid confusion when dates lack years). There is no point applying it after timezone-make-date-arpa-standard since the latter fills in all the blanks. And the former code mistakenly called encode-time on an already-encoded time. This goes back to the code a couple of days ago, except with changed behavior (to fix Bug#52209) only when timezone-make-date-arpa-standard is not called. * test/lisp/calendar/time-date-tests.el (test-date-to-time) (test-days-between): New tests.
* | Fix regression introduced by the previous date-to-time changeKatsumi Yamaoka2021-12-03
| | | | | | | | | | | | * lisp/calendar/time-date.el (date-to-time): The function needs to test if `parse-time-string' returns a valid data as the old version did it with the help of `encode-time' (bug#52209).
* | Make date-to-time work with date-only date stringsBob Rogers2021-12-01
| | | | | | | | | | * lisp/calendar/time-date.el (date-to-time): Try harder to parse dates with no times (bug#52209).
* | decoded-time-add doc string additionLars Ingebrigtsen2021-10-12
|/ | | | * lisp/calendar/time-date.el (decoded-time-add): Add a usage example.
* Use string-replace instead of replace-regexp-in-stringMattias Engdegård2021-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `string-replace` is easier to understand, less error-prone, much faster, and results in shorter Lisp and byte code. Use it where applicable and obviously safe (erring on the conservative side). * admin/authors.el (authors-scan-change-log): * lisp/autoinsert.el (auto-insert-alist): * lisp/calc/calc-prog.el (calc-edit-macro-combine-alg-ent) (calc-edit-macro-combine-ext-command) (calc-edit-macro-combine-var-name): * lisp/calc/calc-units.el (math-make-unit-string): * lisp/calendar/cal-html.el (cal-html-comment): * lisp/calendar/cal-tex.el (cal-tex-comment): * lisp/calendar/icalendar.el (icalendar--convert-string-for-export) (icalendar--convert-string-for-import): * lisp/calendar/iso8601.el (iso8601--concat-regexps) (iso8601--full-time-match, iso8601--combined-match): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/todo-mode.el (todo-filter-items-filename): * lisp/cedet/cedet-files.el (cedet-directory-name-to-file-name) (cedet-file-name-to-directory-name): * lisp/comint.el (comint-watch-for-password-prompt): * lisp/dired-aux.el (dired-do-chmod): * lisp/dired-x.el (dired-man): * lisp/dired.el (dired-insert-directory, dired-goto-file-1): * lisp/emacs-lisp/comp.el (comp-c-func-name): * lisp/emacs-lisp/re-builder.el (reb-copy): * lisp/erc/erc-dcc.el (erc-dcc-unquote-filename): * lisp/erc/erc.el (erc-quit-reason-zippy, erc-part-reason-zippy) (erc-update-mode-line-buffer, erc-message-english-PART): * lisp/files.el (make-backup-file-name-1, files--transform-file-name) (read-file-modes): * lisp/fringe.el (fringe-mode): * lisp/gnus/gnus-art.el (gnus-button-handle-info-url): * lisp/gnus/gnus-group.el (gnus-group-completing-read): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical): * lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy): * lisp/gnus/gnus-search.el (gnus-search-query-parse-date) (gnus-search-transform-expression, gnus-search-run-search): * lisp/gnus/gnus-start.el (gnus-dribble-enter): * lisp/gnus/gnus-sum.el (gnus-summary-refer-article): * lisp/gnus/gnus-util.el (gnus-mode-string-quote): * lisp/gnus/message.el (message-put-addresses-in-ecomplete) (message-parse-mailto-url, message-mailto-1): * lisp/gnus/mml-sec.el (mml-secure-epg-sign): * lisp/gnus/mml-smime.el (mml-smime-epg-verify): * lisp/gnus/mml2015.el (mml2015-epg-verify): * lisp/gnus/nnmaildir.el (nnmaildir--system-name) (nnmaildir-request-list, nnmaildir-retrieve-groups) (nnmaildir-request-group, nnmaildir-retrieve-headers): * lisp/gnus/nnrss.el (nnrss-node-text): * lisp/gnus/spam-report.el (spam-report-gmane-internal) (spam-report-user-mail-address): * lisp/ibuffer.el (name): * lisp/image-dired.el (image-dired-pngnq-thumb) (image-dired-pngcrush-thumb, image-dired-optipng-thumb) (image-dired-create-thumb-1): * lisp/info.el (Info-set-mode-line): * lisp/international/mule-cmds.el (describe-language-environment): * lisp/mail/rfc2231.el (rfc2231-parse-string): * lisp/mail/rfc2368.el (rfc2368-parse-mailto-url): * lisp/mail/rmail.el (rmail-insert-inbox-text) (rmail-simplified-subject-regexp): * lisp/mail/rmailout.el (rmail-output-body-to-file): * lisp/mail/undigest.el (rmail-digest-rfc1153): * lisp/man.el (Man-default-man-entry): * lisp/mouse.el (minor-mode-menu-from-indicator): * lisp/mpc.el (mpc--debug): * lisp/net/browse-url.el (browse-url-mail): * lisp/net/eww.el (eww-update-header-line-format): * lisp/net/newst-backend.el (newsticker-save-item): * lisp/net/rcirc.el (rcirc-sentinel): * lisp/net/soap-client.el (soap-decode-date-time): * lisp/nxml/rng-cmpct.el (rng-c-literal-2-re): * lisp/nxml/xmltok.el (let*): * lisp/obsolete/nnir.el (nnir-run-swish-e, nnir-run-hyrex) (nnir-run-find-grep): * lisp/play/dunnet.el (dun-doassign): * lisp/play/handwrite.el (handwrite): * lisp/proced.el (proced-format-args): * lisp/profiler.el (profiler-report-header-line-format): * lisp/progmodes/gdb-mi.el (gdb-mi-quote): * lisp/progmodes/make-mode.el (makefile-bsdmake-rule-action-regex) (makefile-make-font-lock-keywords): * lisp/progmodes/prolog.el (prolog-guess-fill-prefix): * lisp/progmodes/ruby-mode.el (ruby-toggle-string-quotes): * lisp/progmodes/sql.el (sql-remove-tabs-filter, sql-str-literal): * lisp/progmodes/which-func.el (which-func-current): * lisp/replace.el (query-replace-read-from) (occur-engine, replace-quote): * lisp/select.el (xselect--encode-string): * lisp/ses.el (ses-export-tab): * lisp/subr.el (shell-quote-argument): * lisp/term/pc-win.el (msdos-show-help): * lisp/term/w32-win.el (w32--set-selection): * lisp/term/xterm.el (gui-backend-set-selection): * lisp/textmodes/picture.el (picture-tab-search): * lisp/thumbs.el (thumbs-call-setroot-command): * lisp/tooltip.el (tooltip-show-help-non-mode): * lisp/transient.el (transient-format-key): * lisp/url/url-mailto.el (url-mailto): * lisp/vc/log-edit.el (log-edit-changelog-ours-p): * lisp/vc/vc-bzr.el (vc-bzr-status): * lisp/vc/vc-hg.el (vc-hg--glob-to-pcre): * lisp/vc/vc-svn.el (vc-svn-after-dir-status): * lisp/xdg.el (xdg-desktop-strings): * test/lisp/electric-tests.el (defun): * test/lisp/term-tests.el (term-simple-lines): * test/lisp/time-stamp-tests.el (formatz-mod-del-colons): * test/lisp/wdired-tests.el (wdired-test-bug32173-01) (wdired-test-unfinished-edit-01): * test/src/json-tests.el (json-parse-with-custom-null-and-false-objects): Use `string-replace` instead of `replace-regexp-in-string`.
* Default to 1970 in decoded-time-set-defaultsBasil L. Contovounesios2021-05-09
| | | | | | * lisp/calendar/time-date.el (decoded-time-set-defaults): Set an unspecified year field to 1970, as promised in the docstring, and to ensure it's representable on all systems (bug#48298).
* Update copyright year to 2021Paul Eggert2021-01-01
| | | | Run "TZ=UTC0 admin/update-copyright".
* `format-time' can now do sub-second timesLars Ingebrigtsen2020-10-30
| | | | | | | * doc/lispref/os.texi (Time Parsing): Document it. * lisp/calendar/time-date.el (format-seconds): Allow formatting sub-second times.
* Use lexical-binding in time-date.el and expand testsStefan Kangas2020-10-22
| | | | | | | | | | * lisp/calendar/time-date.el: Use lexical-binding. * test/lisp/calendar/time-date-tests.el (test-obsolete-with-decoded-time-value) (test-obsolete-encode-time-value, test-format-seconds) (test-days-to-time, test-seconds-to-string): New tests. (test-days-in-month, test-time-since, test-time-decoded-period): Expand test with a few more values.
* Fix off-by-one error in decoded-time-add (with months)Lars Ingebrigtsen2020-08-21
| | | | | * lisp/calendar/time-date.el (decoded-time-add): Fix month addition, which was off-by-one.
* Add new function decoded-time-periodLars Ingebrigtsen2020-08-05
| | | | * lisp/calendar/time-date.el (decoded-time-period): New function.
* Improve last changeEli Zaretskii2020-04-03
| | | | | * lisp/calendar/time-date.el (date-days-in-month): Improve the error message text and make sure MONTH is a number. (Bug#40217)
* Error out if 'date-days-in-month' is given an invalid monthAlex Branham2020-04-03
| | | | | | | * lisp/calendar/time-date.el (date-days-in-month): Add test for month validity; signal an error if it isn't. (Bug#40217) * test/lisp/calendar/time-date-tests.el (test-days-in-month): Add a test for the new error.
* Fix iso8601-parse so unknown DST is -1, not nilPaul Eggert2020-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The convention in a decoded time’s dst flag is that t means DST, nil means standard time, and -1 means unknown. This differs from the convention for other components of a decoded time, where nil means unknown. Fix some places where iso8601-parse mistakenly treated nil as meaning that the dst flag was unknown. * doc/lispref/os.texi (Time Parsing): Adjust to match parse-time-string’s doc string. * lisp/calendar/iso8601.el (iso8601-parse): Set dst flag to nil if a numeric time zone or "Z" is given. (iso8601--decoded-time): Default dst flag to -1 if no dst flag or zone is given. * lisp/calendar/time-date.el (decoded-time-set-defaults): When we don’t have a time zone, set the dst flag consistently with DEFAULT-ZONE. * test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years) (test-iso8601-date-dates, test-iso8601-date-obsolete) (test-iso8601-date-weeks, test-iso8601-date-ordinals) (test-iso8601-time, test-iso8601-combined) (test-iso8601-duration, test-iso8601-intervals) (standard-test-dates, standard-test-time-of-day-local-time) (standard-test-time-of-day-fractions) (nonstandard-test-time-of-day-decimals) (standard-test-time-of-day-beginning-of-day) (standard-test-date-and-time-of-day, standard-test-interval): Adjust tests to match fixed behavior.
* Update copyright year to 2020Paul Eggert2020-01-01
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Improve documentation for year-zero issuesPaul Eggert2019-10-05
| | | | | | | | | | | | * doc/emacs/calendar.texi (Calendar Systems) * doc/lispref/os.texi (Time Conversion): Prefer "BC" to "B.C." since the documentation generally uses "BC". * doc/misc/emacs-mime.texi (time-date): * lisp/calendar/time-date.el (date-to-day, time-to-days): In the doc string, state the day origin more clearly, and more consistently with the rest of the documentation. * src/timefns.c (Fdecode_time): State the year origin in the doc string.
* Avoid some excess precision in time arithmeticPaul Eggert2019-08-20
| | | | | | | | | | | | | | | | | | | * doc/misc/emacs-mime.texi (time-date): Adjust example to match new behavior. * etc/NEWS: Mention this. * lisp/calendar/time-date.el (decoded-time-add) (decoded-time--alter-second): Don’t lose underestimate precision of seconds component. * src/bignum.c (mpz): Grow by 1. * src/timefns.c (trillion_factor): New function. (timeform_sub_ps_p): Remove. (time_arith): Avoid unnecessarily-large hz, by reducing the hz to a value no worse than the worse hz of the two arguments. The result is always exact unless an error is signaled. * test/src/timefns-tests.el (timefns-tests--decode-time): New function. (format-time-string-with-zone): Test (decode-time LOOK ZONE t) resolution as well as its numeric value.
* More-compatible subsecond calendrical timestampsPaul Eggert2019-08-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of appending a subseconds member to the result of ‘decode-time’, this keeps the format unchanged unless you give a new optional argument to ‘decode-time’. Also, the augmented format now puts the subsecond info in the SECONDS element, so the total number of elements is unchanged; this is more compatible with code that expects the traditional 9 elements, such as ‘(pcase decoded-time (`(,SEC ,MIN ,HOUR ,DAY ,MON ,YEAR ,DOW ,DST ,ZONE) ...) ...)’. * doc/lispref/os.texi, doc/misc/emacs-mime.texi, etc/NEWS: * lisp/net/soap-client.el (soap-decode-date-time): * lisp/simple.el (decoded-time): Document the new behavior. * lisp/calendar/icalendar.el (icalendar--decode-isodatetime): * lisp/calendar/iso8601.el (iso8601-parse) (iso8601-parse-time, iso8601-parse-duration) (iso8601--decoded-time): * lisp/calendar/parse-time.el (parse-time-string): * lisp/calendar/time-date.el (decoded-time-add) (decoded-time--alter-second): * lisp/org/org.el (org-parse-time-string): * lisp/simple.el (decoded-time): * src/timefns.c (Fdecode_time, Fencode_time): * test/lisp/calendar/icalendar-tests.el: (icalendar--decode-isodatetime): * test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years) (test-iso8601-date-dates, test-iso8601-date-obsolete) (test-iso8601-date-weeks, test-iso8601-date-ordinals) (test-iso8601-time, test-iso8601-combined) (test-iso8601-duration, test-iso8601-intervals) (standard-test-dates, standard-test-time-of-day-fractions) (standard-test-time-of-day-beginning-of-day) (standard-test-time-of-day-utc) (standard-test-time-of-day-zone) (standard-test-date-and-time-of-day, standard-test-interval): * test/lisp/calendar/parse-time-tests.el (parse-time-tests): * test/src/timefns-tests.el (format-time-string-with-zone) (encode-time-dst-numeric-zone): Revert recent changes that added a SUBSECS member to calendrical timestamps, since that component is no longer present (the info, if any, is now in the SECONDS member). * lisp/calendar/time-date.el (decoded-time-add) (decoded-time--alter-second): Support fractional seconds in the new form. Simplify. * src/timefns.c (Fdecode_time): Support new arg FORM. (Fencode_time): Support subsecond resolution. * test/src/timefns-tests.el (format-time-string-with-zone) (decode-then-encode-time): Test subsecond calendrical timestamps.
* Broaden format-seconds to Lisp timestampsPaul Eggert2019-08-16
| | | | | * lisp/calendar/time-date.el (format-seconds): Accept any Lisp timestamp instead of insisting on a number.
* decode-time now returns subsec tooPaul Eggert2019-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list that decode-time returns now contains an extra trailing component that counts the subseconds part of the original timestamp (Bug#36549). This builds on a suggestion by Lars Ingebrigtsen in: https://lists.gnu.org/r/emacs-devel/2019-07/msg00734.html * doc/lispref/os.texi (Time Conversion): * doc/misc/emacs-mime.texi (time-date): * etc/NEWS: Document this. * lisp/calendar/icalendar.el (icalendar--decode-isodatetime): * lisp/calendar/iso8601.el (iso8601-parse) (iso8601-parse-time, iso8601-parse-duration) (iso8601--decoded-time): * lisp/calendar/parse-time.el (parse-time-string): * lisp/calendar/time-date.el (make-decoded-time) (decoded-time-set-defaults): * lisp/org/org.el (org-fix-decoded-time) (org-parse-time-string): * src/timefns.c (Fdecode_time): Generate subsec member for decoded time. * lisp/calendar/time-date.el (decoded-time-add) Add the decoded subsec too. * lisp/simple.el (decoded-time): New subsec member. * src/data.c (Frem): Simplify zero-check to match that of new Fmod. (integer_mod): New function, with most of the guts of the old Fmod. Remove redundant zero-check. (Fmod): Use it. * src/timefns.c (Fencode_time): Handle new subsec member or (with the obsolescent calling convention) subsec arg. It defaults to 0. * test/lisp/calendar/icalendar-tests.el: (icalendar--decode-isodatetime): * test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years) (test-iso8601-date-dates, test-iso8601-date-obsolete) (test-iso8601-date-weeks, test-iso8601-date-ordinals) (test-iso8601-time, test-iso8601-combined) (test-iso8601-duration, test-iso8601-intervals) (standard-test-dates, standard-test-time-of-day-fractions) (standard-test-time-of-day-beginning-of-day) (standard-test-time-of-day-utc) (standard-test-time-of-day-zone) (standard-test-date-and-time-of-day, standard-test-interval): * test/lisp/calendar/parse-time-tests.el (parse-time-tests): * test/src/timefns-tests.el (format-time-string-with-zone) (encode-time-dst-numeric-zone): Adjust to match new behavior.
* New function time-convertPaul Eggert2019-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the awkward reuse of encode-time to both convert calendrical timestamps to Lisp timestamps, and to convert Lisp timestamps to other forms. Now, encode-time does just the former and the new function does just the latter. The new function builds on a suggestion by Lars Ingebrigtsen in: https://lists.gnu.org/r/emacs-devel/2019-07/msg00801.html and refined by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2019-07/msg00803.html * doc/lispref/os.texi (Time of Day, Time Conversion): * doc/misc/emacs-mime.texi (time-date): * etc/NEWS: Update documentation. * lisp/calendar/cal-dst.el (calendar-next-time-zone-transition): * lisp/calendar/time-date.el (seconds-to-time, days-to-time): * lisp/calendar/timeclock.el (timeclock-seconds-to-time): * lisp/cedet/ede/detect.el (ede-detect-qtest): * lisp/completion.el (cmpl-hours-since-origin): * lisp/ecomplete.el (ecomplete-add-item): * lisp/emacs-lisp/cl-extra.el (cl--random-time): * lisp/emacs-lisp/timer.el (timer--time-setter) (timer-next-integral-multiple-of-time): * lisp/find-lisp.el (find-lisp-format-time): * lisp/gnus/gnus-diary.el (gnus-user-format-function-d): * lisp/gnus/gnus-group.el (gnus-group-set-timestamp): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-show-org-agenda): * lisp/gnus/nnrss.el (nnrss-normalize-date): * lisp/gnus/nnspool.el (nnspool-request-newgroups): * lisp/net/ntlm.el (ntlm-compute-timestamp): * lisp/net/pop3.el (pop3-uidl-dele): * lisp/obsolete/vc-arch.el (vc-arch-add-tagline): * lisp/org/org-clock.el (org-clock-get-clocked-time) (org-clock-resolve, org-resolve-clocks, org-clock-in) (org-clock-out, org-clock-sum): * lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36): * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src): * lisp/proced.el (proced-format-time): * lisp/progmodes/cc-cmds.el (c-progress-init) (c-progress-update): * lisp/progmodes/cperl-mode.el (cperl-time-fontification): * lisp/progmodes/flymake.el (flymake--schedule-timer-maybe): * lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info) (vhdl-fix-case-region-1): * lisp/tar-mode.el (tar-octal-time): * lisp/time.el (emacs-uptime): * lisp/url/url-auth.el (url-digest-auth-make-cnonce): * lisp/url/url-util.el (url-lazy-message): * lisp/vc/vc-cvs.el (vc-cvs-parse-entry): * lisp/vc/vc-hg.el (vc-hg-state-fast): * lisp/xt-mouse.el (xterm-mouse-event): * test/lisp/emacs-lisp/timer-tests.el: (timer-next-integral-multiple-of-time-2): Use time-convert, not encode-time. * lisp/calendar/icalendar.el (icalendar--decode-isodatetime): Don’t use now-removed FORM argument for encode-time. It wasn’t crucial anyway. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add time-convert. * lisp/emacs-lisp/elint.el (elint-unknown-builtin-args): Update encode-time signature to match current arg set. * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time): Use timer-convert with t rather than doing it by hand. * src/timefns.c (time_hz_ticks, time_form_stamp, lisp_time_form_stamp): Remove; no longer needed. (decode_lisp_time): Rturn the form instead of having a *PFORM arg. All uses changed. (time_arith): Just return TICKS if HZ is 1. (Fencode_time): Remove argument FORM. All callers changed. Do not attempt to encode time values; just encode decoded (calendrical) times. Unless CURRENT_TIME_LIST, just return VALUE since HZ is 1. (Ftime_convert): New function, which does the time value conversion that bleeding-edge encode-time formerly did. Return TIME if it is easy to see that it is already of the correct form. (Fcurrent_time): Mention in doc that the form is planned to change. * test/src/timefns-tests.el (decode-then-encode-time): Don’t use (encode-time nil).
* Improve time function docPaul Eggert2019-08-04
| | | | | | | | * doc/misc/emacs-mime.texi (time-date): Don’t give parse-iso8601-time-string in the example, as the function is not autoloaded. * lisp/gnus/nndiary.el (nndiary-compute-reminders): No need to call encode-time or use floating point here.
* ; Use more decoded time accessors in time-date.elBasil L. Contovounesios2019-08-01
| | | | | | These were overlooked in a recent change. * lisp/calendar/time-date.el (time-date--day-in-year): Use decoded time accessors.
* format-time-string subsumes time-zone-formatPaul Eggert2019-07-31
| | | | | | | | * lisp/calendar/time-date.el (time-zone-format): * test/lisp/calendar/time-date-tests.el (test-time-zone-format): Remove. * lisp/gnus/nnrss.el (nnrss-normalize-date): Use format-time-string instead of time-zone-format.
* Allow timezone defaults in decoded-time-set-defaultsLars Ingebrigtsen2019-07-31
| | | | | | * lisp/calendar/time-date.el (decoded-time-set-defaults): Allow passing in a default time zone, as this seems to be something callers seem to do.
* Default DST to "undecided" in decoded-time-set-defaultsLars Ingebrigtsen2019-07-31
| | | | | * lisp/calendar/time-date.el (decoded-time-set-defaults): When we don't have a zone or a DST, set DST to "undecided".
* Make time-zone-format take a SHORT parameterLars Ingebrigtsen2019-07-31
| | | | | * lisp/calendar/time-date.el (time-zone-format): Accept an optional SHORT parameter.
* Add new function time-zone-formatLars Ingebrigtsen2019-07-31
| | | | * lisp/calendar/time-date.el (time-zone-format): New function.
* `decoded-time-set-defaults' refactored out from iso8601 codeLars Ingebrigtsen2019-07-31
| | | | | | | * lisp/calendar/iso8601.el (iso8601--encode-time): * lisp/calendar/time-date.el (decoded-time-set-defaults): Refactor out from `iso8601--encode-time', because it's helpful in other contexts.
* Use decoded time accessors in time-dateLars Ingebrigtsen2019-07-30
| | | | | * lisp/calendar/time-date.el (time-to-days): Use decoded time accessors.
* Add support for dealing with decoded time structuresLars Ingebrigtsen2019-07-29
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/os.texi (Time Conversion): Document the new functions that work on decoded time. (Time Calculations): Document new date/time functions. * lisp/simple.el (decoded-time-second, decoded-time-minute) (decoded-time-hour, decoded-time-day, decoded-time-month) (decoded-time-year, decoded-time-weekday, decoded-time-dst) (decoded-time-zone): New accessor functions for decoded time values. * lisp/calendar/time-date.el (date-days-in-month) (date-ordinal-to-time): New functions. (decoded-time--alter-month, decoded-time--alter-day) (decoded-time--alter-second, make-decoded-time): New functions added to manipulate decoded time structures. * src/timefns.c (Fdecode_time): Mention the new accessors. * test/lisp/calendar/time-date-tests.el: New file to test the decoded time functions and the other new functions.
* Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo"Stefan Monnier2019-06-26
| | | | This reverts commit 698ff554ac2699ec48fefc85a1307cbc4a183b0d.
* * lisp/calc/calc-ext.el (math-scalarp): Fix typoStefan Monnier2019-06-26
|
* Remove time-date debugging scaffoldingPaul Eggert2019-05-21
| | | | | | | Problem reported by Lars Ingebrigtsen in: https://lists.gnu.org/r/emacs-devel/2019-05/msg00721.html * lisp/calendar/time-date.el (date-to-time): Use plain condition-case, not condition-case-unless-debug.
* * lisp/calendar/time-date.el (date-to-time): 'signal' only takes 2 argsStefan Monnier2019-04-19
|
* Simplify use of encode-timePaul Eggert2019-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most uses of (apply #'encode-time foo) can now be replaced with (encode-time foo). Make similar simplifications. * lisp/calendar/time-date.el (date-to-time): * lisp/calendar/timeclock.el (timeclock-when-to-leave) (timeclock-day-base, timeclock-generate-report): * lisp/emacs-lisp/timer.el (timer-set-idle-time): * lisp/eshell/esh-util.el (eshell-parse-ange-ls): * lisp/gnus/gnus-art.el (article-make-date-line): * lisp/gnus/gnus-delay.el (gnus-delay-article) (gnus-delay-send-queue): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event--decode-datefield): * lisp/gnus/gnus-logic.el (gnus-advanced-date): * lisp/gnus/message.el (message-make-expires-date): * lisp/gnus/nndiary.el (nndiary-compute-reminders): * lisp/mail/ietf-drums.el (ietf-drums-parse-date): * lisp/net/tramp-adb.el (tramp-adb-ls-output-time-less-p): * lisp/org/org-agenda.el (org-agenda-get-timestamps) (org-agenda-get-progress, org-agenda-show-clocking-issues): * lisp/org/org-capture.el (org-capture-set-target-location): * lisp/org/org-clock.el (org-clock-get-sum-start, org-clock-sum) (org-clocktable-steps): * lisp/org/org-colview.el (org-colview-construct-allowed-dates) * lisp/org/org-macro.el (org-macro--vc-modified-time): * lisp/org/org-table.el (org-table-eval-formula): * lisp/org/org.el (org-current-time, org-store-link) (org-time-today, org-read-date, org-read-date-display) (org-display-custom-time, org-time-string-to-time) (org-timestamp-change, org-timestamp--to-internal-time): * lisp/url/url-dav.el (url-dav-process-date-property): * lisp/vc/vc-cvs.el (vc-cvs-annotate-current-time) (vc-cvs-parse-entry): Simplify use of encode-time. * lisp/org/org-clock.el (org-clock-get-clocked-time): (org-clock-resolve, org-resolve-clocks, org_clock_out) (org-clock-update-time-maybe): Avoid some rounding problems with encode-time and float-time. * lisp/org/org-clock.el (org-clock-in, org-clock-update-time-maybe): * lisp/org/org-colview.el (org-columns--age-to-minutes): * lisp/org/org.el (org-get-scheduled-time, org-get-deadline-time) (org-add-planning-info, org-2ft, org-time-string-to-absolute) (org-closest-date): Use org-time-string-to-time instead of doing it by hand with encode-time. * lisp/org/org.el (org-current-time): Simplify rounding. (org-read-date): Avoid extra trip through encode-time.