PyCon Israel 2023

🇮🇱 Date for two: Server, Client, and Datetime in a Multi-timezone environment
2023-07-04, 14:30–14:50, Main hall

Datetime in your DB is easy when your app is local, but what if one client writes in USA and another reads from France? We’ll see some challenges in adding time constraints to a global app and suggest the aviation industry methodology to solve them.


Any complex Django-based app will include many models that use the DateTime field, and the clients use those fields.

Assuming all our clients will always be in the same timezone is wrong for a globally used app.
Pythons DateTime and pytz packages can help you localize the information, but what is the “right localization”? And more importantly, how can we assume where to localize from?

When designing a flow that handles DateTime fields in server-client data exchange, timezone conversions are the main issue.

Another challenge is what can we assume about the DateTime data that comes from the client when they send a PUT request with a DateTime field? What should the response assume? What if the client sends a GET request without any additional data?

In this talk, we will address those issues by demonstrating a simple “Timed Assignment App” that can be used globally.
I’ll show the thought process that might go through your mind when designing the time features for this app, try different solutions using python packages, and finally suggest the “aviation method” for solving all the problems before they even happen.


Session language – Hebrew Target audience – Developers