Subject: bug#11281: DST has not effect on windows XP when system DST adjustment is disabled

From: Eli Zaretskii <[email-masked]>
Date: Fri, 23 May 2025 13:28:10 +0300

> Date: Fri, 23 May 2025 17:32:15 +0900
> From: Kazuhiro Ito <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
> > > (let ((time (encode-time '(0 0 12 20 5 2025 nil nil t))))
> > >   ;; The result depends on whether DST is enabled on Windows timezone
> > >   ;; setting at the time of evaluating `(setenv "TZ" nil)'.
> > >   (setenv "TZ" nil)
> > >   (decode-time time "est5edt"))
> > > 
> > > ;; The case that DST is disabled on Windows control panel.
> > > -> (0 0 7 20 5 2025 2 t -18000)
> > > 
> > > ;; DST is enabled.
> > > -> (0 0 8 20 5 2025 2 t -14400)
> (snip)
> 
> > My suggestion therefore is not to try such tricks in Emacs on Windows,
> > and not to expect that to produce results that are as accurate as on
> > Posix platforms.
> 
> Thank you for the comment.
> What do you mean by 'such tricks'?  Using traditional timezone name or
> using string as a ZONE pamareter?

Neither.  By "tricks" I meant unchecking the DST option in the Windows
Control Panel.

> If the former, what is proper string for ZONE on Windows?

In Emacs, the only supported TZ strings are those known to MSVCRT
time-related functions, which are of the form documented here:

  https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset?view=msvc-170