Re:What every programmer should know about time
by nolite on Sunday July 03, 2011 @10:37PM
(#2725185)
What about when you're storing things at a date/hour/or even minute granularity.. not seconds.. is this still as important?
[ Parent
| on HN ]
Re:What every programmer should know about time
by geuis on Sunday July 03, 2011 @11:09PM
(#2725237)
We solved this by storing metadata around the timestamps. For us, it was an ID that referenced a global table of polities that use daylight savings and we could derive the current GMT offset from that. We could theoretically update the polities table over time as these changed, though while I was there we never did.
As for granularity, you can derive day/minute/hour etc based on the timestamp. For us, we were able to do those calculations in the application layer. For other types of projects, you can store that data in the db if you need to do more efficient queries for example.