Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

returned datetime.timezone when api states it returns ZoneInfo objects #161

Open
alejcas opened this issue May 30, 2024 · 0 comments
Open

Comments

@alejcas
Copy link

alejcas commented May 30, 2024

Hi,

On O365 we use tzlocal to get a default timezone for our users.

One of our users has reported an issue O365/python-o365#1077.

It seems that on his system tzlocal is unable to find the system timezone and then returned UTC.

The problem we have is that the returned type for this "UTC" is datetime.timezone which is a tzinfo object and not a ZoneInfo object

As stated by the tzlocal readme:

Version 5.0 removes the pytz_deprecation_shim, and now only returns zoneinfo objects,

We depend on the tzlocal returning ZoneInfo objects because we need to use the "key" attribute to translate IANA to WINDOWS timezones.

¿Can you please see why is tzlocal returning datetime.timezone and not ZoneInfo objects in this particular case?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant