Re: 2017-03-06- UTC, TImeZone, DayLight Saving Shifts, Enconding


You can already do all of this (except maybe for leap seconds, if you have an app that cares about one second every few years I feel for you), by storing every datetime in UTC (Z timezone of ISO 8601), and converting to local time in the presentation layer, with the TZ database. It's a good idea to convert using the database as a last step anyway, it avoids widespread data corruption when the database has not been updated timely on the local system. And it needs updating since governments can be fickle.

Storing anything in local time like dos-like systems like to do is a recipe for failure (I've even seen some of them invent local time UNIX timestamps !)

See also the W3C datetime profile of ISO 8601 that every one uses practically to transmit datetimes portably. It requires the sender to convert timezones to UTC offset so the rest of the software ecosystem does not have to care about it.


Nicolas Mailhot

Received on Tuesday, 7 March 2017 08:15:38 UTC