regebro / tzlocal

A Python module that tries to figure out what your local timezone is
MIT License
184 stars 58 forks source link

Possible Bug: Can not find timezone Northwest Time Border M�xico #118

Closed Saijin-Naib closed 2 years ago

Saijin-Naib commented 2 years ago
grass78\\Python37\\lib\\site-packages\\tzlocal\\win32.py\", line 79, in get_localzone_name
raise pytz.UnknownTimeZoneError('Can not find timezone ' + tzkeyname)
pytz.exceptions.UnknownTimeZoneError: 'Can not find timezone Northwest Time Border M�xico'"
"python: exited with code 1"

Not sure if this is an issue with the Windows installation reporting something strange, Python 3.7, or tzlocal not having this zone.

Looking at the IANA tzdata packages, this is indeed not a real Time Zone for Mexico, as IANA only identifies three zones:
Baja California Norte (the Mexico/BajaNorte TZ) Baja California Sur, Nayarit, Sinaloa and Sonora (the Mexico/BajaSur TZ) The rest of the country (the Mexico/General TZ)

regebro commented 2 years ago

Correct, the timezone "Northwest Time Border Mexico" doesn't exist, and in fact Google can't find that phrase anywhere. Try re-configuring your timezone in the control panel. I suspect they mean the "Tiempo del Noroeste" zone, which in zoneinfo terms is called "America/Tijuana", and in Windows should be called "Pacific Standard Time (Mexico)".

It's the same as US pacific time, so if you want you can try choosing that timezone instead, and it should work.

Saijin-Naib commented 2 years ago

Thank you!

It looks like they have their machine set for UTC -12.

Does it make sense to you that this was misreported?

image001.png

regebro commented 2 years ago

No, I don't think they have configured it like that, I think the control panel gets nonsense configuration and probably shows the first or the last entry in the list as a result. This increases the likelihood that setting it to the correct timezone will fix the problem.

Saijin-Naib commented 2 years ago

You were correct! Thanks so much.

Saijin-Naib commented 2 years ago

Hate to make noise, but having the same issue but from the opposite side now!

"python:     raise pytz.UnknownTimeZoneError('Can not find timezone ' + tzkeyname)\r\npytz.exceptions.UnknownTimeZoneError: 'Can not find timezone Pacific Standard Time (Mexico)'\r\n"

I'll have them change/re-confirm their timezone again.