This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients belopolsky, eryksun, mikekaganski, p-ganssle, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-06-10.04:31:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623299496.35.0.75151698046.issue44352@roundup.psfhosted.org>
In-reply-to
Content
> 2. Execute 'set TZ=Europe/Moscow'

The Windows C runtime supports a simple format for the TZ environment variable, which is detailed in the documentation of _tzset() [1]. For example, it's "MSK-3" for Moscow Standard Time. It's -3 because the offset is from local time to UTC. 

The CRT does not verify that the TZ value is valid. "Europe/Moscow" is invalid, but it's blindly parsed anyway. There's no UTC offset, so it defaults to UTC (0 offset). It's parsed as supporting daylight saving time, according to U.S. rules. Currently this corresponds to UTC + 1. That's why there's a -2 hour delta from Moscow Standard Time, which does not observe daylight saving time.

I recommend that you unset the TZ environment variable before running Windows Python. Use the system timezone.

---
[1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset?view=msvc-160
History
Date User Action Args
2021-06-10 04:31:36eryksunsetrecipients: + eryksun, paul.moore, belopolsky, tim.golden, zach.ware, steve.dower, p-ganssle, mikekaganski
2021-06-10 04:31:36eryksunsetmessageid: <1623299496.35.0.75151698046.issue44352@roundup.psfhosted.org>
2021-06-10 04:31:36eryksunlinkissue44352 messages
2021-06-10 04:31:35eryksuncreate