GNU bug report logs -
#11281
DST has not effect on windows XP when system DST adjustment is disabled
Previous Next
Full log
View this message in rfc822 format
> Date: Fri, 23 May 2025 22:39:51 +0900
> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> Cc: 11281 <at> debbugs.gnu.org,
> stefankangas <at> gmail.com
>
> > Do the problems mentioned in this bug happen when you use Emacs? If
> > so, can you show a recipe which involves only Emacs, and does not
> > touch any TZ settings in the Windows Control Panel?
>
> 1. Set timezone to Japanese Standard Time (at UTC+09:00, Osaka,
> Sapporo, Tokyo) in the Windows Control Panel. DST option doesn't
> apprear.
>
> 2. emacs -Q
>
> 3. Evaluate below code.
>
> (let ((time (encode-time '(0 0 12 20 5 2025 nil nil t))))
> (setenv "TZ" nil)
> (decode-time time "est5edt"))
>
> Expected result: (0 0 8 20 5 2025 2 t -14400)
> Actual result: (0 0 7 20 5 2025 2 t -18000)
>
> As far as I tested, the result depends on whether DST is enabled in
> the Windows Control Panel at the time of evaluating `(setenv "TZ"
> nil)'. In the case of Windows timezone which doesn't have DST, the
> result is the same with unchecking DST option.
I think this is because MSVCRT routines assume that every time zone
has DST and changes to and from DST on certain fixed dates. IOW, they
don't support timezones without DST and don't access the Windows
settings for the actual timezone you are using. So the conversion to
EST5EDT is performed as if your timezone also had DST and the DST were
in effect at that date.
This bug report was last modified 19 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.