question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use ZoneInfo instead of pytz on Python 3.9+

See original GitHub issue

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
agronholmcommented, Sep 6, 2020

@regebro If you’re interested, I’d like to see some similar functionality to this added to the zoneinfo module in Python 3.10. I was going to write it myself, but I’d be happy to have an expert collaborator smile.

I’m not sure we want this in the standard library since this library has quite a few kludges to get the time zone information out of the (sometimes uncooperative) operating systems.

I am however eager to see a pytz-free version of this library. Maybe somebody should fork it if @regebro does not want to mess with zoneinfo in this one.

1reaction
pgansslecommented, May 19, 2020

I assume that this will be a breaking change, because pytz zones are used very differently from standard tzinfos. End users will need to stop using .localize.

@regebro If you’re interested, I’d like to see some similar functionality to this added to the zoneinfo module in Python 3.10. I was going to write it myself, but I’d be happy to have an expert collaborator 😄.

Read more comments on GitHub >

github_iconTop Results From Across the Web

zoneinfo — IANA time zone support — Python 3.11.1 ...
The zoneinfo module does not directly provide time zone data, and instead pulls time zone information from the system time zone database or...
Read more >
Proposal: Drop dependency on pytz in favor of zoneinfo
- In version X, Django deprecates usage of pytz and introduces the TIMEZONE setting. It has the same meaning as TIME_ZONE, but the...
Read more >
zoneinfo: A stunning module of exceptional quality
Python's Time Zone Model ## `tzinfo` * Time zones are provided by *subclassing* `tzinfo`. * Information provided is a function of the datetime:...
Read more >
Replace pytz.UTC with zoneinfo('UTC') · Issue #1440 - GitHub
We're using pytz.UTC for timezone-aware dates. Python 3.9 has added zoneinfo as a standard module. If we use this, then pytz can be...
Read more >
Regarding the pytz module and the time module in Python
Note: pytz is now obsolete (since two weeks), so with Python 3.9 you can uses directly standard libraries. The problem: pytz is updated ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found