Need to work with timezones in #Python?

Don't use pytz! Use zoneinfo.

It's included in the Python standard library from Python 3.9 onward and pip install-able if you're on Python 3.8.

If your code needs to run on Windows, note that you'll need to pip install tzdata to use Python's zoneinfo module properly.

If you're really curious to understand this topic deeply, watch @pganssle's talk from @pycon: m.youtube.com/watch?v=rYzgroaK

@treyhunner @pganssle @pycon I would say "use pendulum", because most people have probably not the knowledge nor the time to deal with time calculation with timezones correctly if they have to do it manually.

Follow

@bitecode @treyhunner @pycon I would disagree with this in the strongest terms.

@pganssle @treyhunner @pycon You literally coded zoneinfo, so of course for you it's all obvious :)

@bitecode @treyhunner @pycon No, I started where everyone else did and I still don't recommend pendulum. They have a somewhat incoherent model, are much slower.

@pganssle @treyhunner @pycon Every expert has, nobody is born one.

The simple fact you know they have an "incoherent model" put you in the 0.0000000001%

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.