Contribute Media
A thank you to everyone who makes this possible: Read More

A Day Has Only 24±1 Hours

Translations: en en

Description

On the first Sunday of November you may get “one more hour of sleep” but as well may spend much more time debugging code dealing with the time zones, daylight saving time shifts and datetime stuff in general. We'll look at a few pitfalls you may encounter when working with datetimes in Python. We'll dissect the pytz library, explain why it contains over 400 individual time zones while focusing on the 29 entries in the USA. We'll also find the reason why pytz is not part of the standard Python, why it gets updated so often and why even that won't solve all your problems. And no, PEP 615 will not save you either. Two centuries of short-sighted propaganda and long-term chaos in ten minutes. Maybe that will make you want to avoid time zones in your code altogether!

Details

Improve this page