Re:Storing Date/Times in Databases
by gbog on Monday May 14, 2012 @09:36AM
(#3970989)
The main gotcha with datetime + timezone saved in database fields is that such a value is mutable, and therefore can't be indexed. I didn't see this in the article. Moreover, you should store fixed facts in a database. So you have to choose between "this happened at that tick on a universal clock" and "when this happened wall time at this place was x". The former is a well defined mathematical value you can build on, the later are strings with very few useful usage.
I have been bitten more than once. Now my rule is to always store universal time without timezone.
I have been bitten more than once. Now my rule is to always store universal time without timezone.