Backend May 1, 2019

Working with Time Zones: Everything You Wish You Didn't Need to Know

Time zones are complicated, but they are a fact of engineering life. Time zones have [skipped entire days](http://www.bbc.com/news/world-asia-16…) and repeated others. There are time zones that switch to [DST twice per year](https://www.timeanddate.com/time/zone…). But not necessarily every year. In Python it’s even possible to create datetimes with non-transitive equality (`a == b`, `b == c`, `a != c`). In this talk you’ll learn about Python’s time zone model and other concepts critical to avoiding datetime troubles. Using `dateutil` and `pytz` as examples, this talk covers how to deal with ambiguous and imaginary times, datetime arithmetic around a Daylight Savings Time transition, and datetime’s new `fold` attribute, introduced in Python 3.6 ([PEP 495](https://www.python.org/dev/peps/pep-0…)). Slides can be found at: https://speakerdeck.com/pycon2019 and https://github.com/PyCon/2019-slides"