summaryrefslogtreecommitdiff
path: root/lisp/calendar/time-date.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-05-27 12:19:43 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2022-05-27 12:19:59 -0700
commitd9879e686d2124f28dbe15342a02166c5739abb9 (patch)
treecaf7de5f1e4b7975783e047e96087c4c80940dbb /lisp/calendar/time-date.el
parenteb37e4814e354befaa12f80dc5e75368ad489a1e (diff)
downloademacs-d9879e686d2124f28dbe15342a02166c5739abb9.tar.gz
decoded-time-set-defaults now leaves DST alone
* lisp/calendar/time-date.el (decoded-time-set-defaults): Don’t mess with decoded-time-dst (Bug#55635).
Diffstat (limited to 'lisp/calendar/time-date.el')
-rw-r--r--lisp/calendar/time-date.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index dc77a7c7e0a..40374c3bb4e 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -562,6 +562,9 @@ The default value is based on January 1st, 1970 at midnight.
This year is used to guarantee portability; see Info
node `(elisp) Time of Day'.
+Optional argument DEFAULT-ZONE specifies what time zone to
+default to when TIME's time zone is nil (meaning local time).
+
TIME is modified and returned."
(unless (decoded-time-second time)
(setf (decoded-time-second time) 0))
@@ -577,13 +580,11 @@ TIME is modified and returned."
(unless (decoded-time-year time)
(setf (decoded-time-year time) 1970))
- ;; When we don't have a time zone, default to DEFAULT-ZONE without
- ;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.
(unless (decoded-time-zone time)
- (if default-zone
- (progn (setf (decoded-time-zone time) default-zone)
- (setf (decoded-time-dst time) nil))
- (setf (decoded-time-dst time) -1)))
+ (setf (decoded-time-zone time) default-zone))
+
+ ;; Do not set decoded-time-weekday or decoded-time-dst,
+ ;; as encode-time can infer them well enough when unknown.
time)