pganssle / zoneinfo

Reference implementation for the proposed standard library module zoneinfo
Other
52 stars 20 forks source link

ZoneInfo('America/Mexico_City') subtracts one hour less from UTC #138

Closed tribumirkov closed 1 year ago

tribumirkov commented 1 year ago

Hey folks,

Mexico decided not to move any more to summer time from 2023 on (don't ask me why):

https://www.marca.com/mx/actualidad/2023/03/28/6423471a46163f89688b45c3.html

ZoneInfo should therefore be adjusted.

To reproduce the error:

from zoneinfo import ZoneInfo from datetime import datetime

utc = datetime.utcnow() mexican_zone = ZoneInfo('America/Mexico_City') local = utc.replace(tzinfo=timezone.utc).astimezone(mexican_zone) print(local)

Thank you!

pganssle commented 1 year ago

ZoneInfo does not hard code the zones, they are provided by your operating system or tzdata