GNU bug report logs -
#55635
`make-decoded-time' incorrectly sets DST to nil, it should be -1 (guess)
Previous Next
Full log
View this message in rfc822 format
On 5/26/22 05:13, Lars Ingebrigtsen wrote:
> perhaps -1 is less "filled out" than nil in this
> case.
Indeed it is, and make-decoded-time's DST flag should default to -1.
It's unfortunate that nil means "standard time" in these contexts. In
hindsight some other symbol should have been used to mean "standard
time". Could be too late to change this though.
> It's this code, I guess:
>
> ;; 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)))
This looks wrong. Shouldn't it leave the DST flag alone? I.e., just this:
(unless (decoded-time-zone time)
(setf (decoded-time-zone-time) default-zone))
That is, if we assume that for the DST component -1 means "unknown" and
nil means "standard time", it should be OK for decoded-time-set-defaults
to leave the DST component alone, for the same reason that it leaves the
DOW component alone.
This bug report was last modified 2 years and 338 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.