Pycon Sweden 2024

It's About Time
2024-11-14 , Auditorium

It's About Time is set out to be an overview of time programming, to enlighten about the particular pitfalls and general problem space that we face when programming around the context of time.

We will look at some key points:
- Serialisation and the representation of time
- Accessibility when presenting date/time on the web
- Good practices for API design (OpenAPI specification)
- Timezones and Daylight savings
- Special Relativity, and how this can make things even weirder
- What I would consider to be best practices when writing code in python.

Hopefully, put purely speculative I hope that my talk may be inspiring in getting people to have a peek into the pandora's box which is time - in order to help people understand that maybe everything is not always as easy as we assume them to be.

This talk has been presented once at the university of KTH at its full length (not recorded), and a much cut down version during PyCon 2022 as a lightning talk. But I am excited for the opportunity and the great honour of present the full version.


We're starting the talk by presenting what and why we're talking about time. Some common misconceptions around time, which mostly all stem from human presumptions about how time works. Many of them are due to simplifications we as a species have made.

Some thoughts about accessibility, and what may be important to think about when presenting time to users.

Then we go though the localisation of time, as example, famously middle-endian-ness that more often than not create confusion between cultures.

We will go through timezones, and how they are subject to change over time, and how even some countries like Sweden use "daylight savings" to make things even more confusing. All countries don't even apply the DST at the same time, or even through the whole country as a whole creating endless confusion.

We will go though one of the greatest inventions for helping us with coordinating time around the globe, the synchronisation of atomic clocks, and what the strange(?) definition of a second precisely is.

And then once we think we had a good solution, A wrench is thrown into our gears, as special relativity and the universe itself steps into the mix. Luckily we won't have much problems just on earth, but if you're programming things like GPS satellites, then you're affected.

Then we land back on earth, and stalk about python programmings - tips and tricks in particular. Like how one should not use date.utcnow() (as stated in the documentation), using timedeltasand remembering the inclusion of tz in dates.

I will also mention the excellent freezegun package and how one could more easily write test code around code that otherwise may be hard to test.

Petter is an consultant in Stockholm, who has a wide range of experience in programming, and many different languages. He strives to build high quality systems, and together with his co-workers become better every day at what they do - creating systems to help people.