3 ms·
His suggestion that storing datetimes in UTC may be a problem is only half-correct. If you have access to an accurate historical record of rules for a given zon
by autarch 17y ago
His suggestion that storing datetimes in UTC may be a problem is only half-correct. If you have access to an accurate historical record of rules for a given zone, then you _can_ always store UTC.
On Unixen, this data is typically stored somewhere like /usr/share/zoneinfo, and is called the zoneinfo or Olson database (Arthur David Olson is the original creator and maintainer of this database).
Using this database, you will always get the right conversion, even for datetimes that predate recent shift in DST rules.
OTOH, if you're on a crippled system that assumes the most recent rules extend indefinitely back in time, then storing data in UTC only will be problematic.