|
|
|
|
|
by manarth
3457 days ago
|
|
Sometimes it's best to store a scheduled events as "Event localtime" and "Timezone" (where timezone is a named description - e.g. "Europe/Madrid" - rather than an offset - e.g. "+1:00"). This allows the record to stay consistent, even if there are changes to the local time rules - e.g. leap seconds, daylight savings, timezone offset. Imagine a tech-camp had been planned in Cairo, Egypt, to start on 9am on July 10, 2016: that would have been scheduled for 06:00 UTC. When Egypt cancelled daylight savings with three days notice, that record should then have been 07:00 UTC. |
|
As an aside, how often do the tz databases for each language get released? Are they usually responsive to notices 3 days out?
Edit: I went looking into the pytz release for the Cairo example from parent.
Olson Timezone Database:
Release 2016f - 2016-07-05 16:26:51 +0200
https://github.com/stub42/pytz/commit/03a4e9b31dd90f3dace1eb...
Pytz:
Release 2016.6 - 2016-07-13
https://pypi.python.org/pypi/pytz/2016.6
So even if the tz database is up to date, there's no guarantee that various library usages of the tz database will be correct for these kinds of changes. Interesting.