From d9879e686d2124f28dbe15342a02166c5739abb9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 27 May 2022 12:19:43 -0700 Subject: [PATCH] decoded-time-set-defaults now leaves DST alone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/calendar/time-date.el (decoded-time-set-defaults): Don’t mess with decoded-time-dst (Bug#55635). --- lisp/calendar/time-date.el | 13 +++++++------ 1 file 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)