[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 2533a60e425: * lisp/calendar/time-date.el: Add comment.
From: |
Paul Eggert |
Subject: |
master 2533a60e425: * lisp/calendar/time-date.el: Add comment. |
Date: |
Wed, 14 Aug 2024 23:37:43 -0400 (EDT) |
branch: master
commit 2533a60e4256336eb30786a555a8922326c49a8a
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
* lisp/calendar/time-date.el: Add comment.
---
lisp/calendar/time-date.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index eca80f1e8b6..b441974b943 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -154,6 +154,11 @@ it is assumed that PICO was omitted and should be treated
as zero."
DATE should be in one of the forms recognized by `parse-time-string'.
If DATE lacks timezone information, GMT is assumed."
(condition-case err
+ ;; Parse DATE. If it contains a year, use defaults for other components.
+ ;; Then encode the result; this signals an error if the year is missing,
+ ;; because encode-time signals if crucial time components are nil.
+ ;; This heuristic uses local time if the string lacks time zone info,
+ ;; because encode-time treats a nil time zone as local time.
(let ((parsed (parse-time-string date)))
(when (decoded-time-year parsed)
(decoded-time-set-defaults parsed))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 2533a60e425: * lisp/calendar/time-date.el: Add comment.,
Paul Eggert <=