3 ms·
That's why I always distinguish two types of times: A point in time, and the name of a time. A point in time should be stored as a timestamp (unixtime) and con
by ars 15y ago
That's why I always distinguish two types of times: A point in time, and the name of a time.
A point in time should be stored as a timestamp (unixtime) and converted to local at the point of presentation.
A name of a time should be stored as a datetime column with no timezone and should not be adjusted by timezone.
The hard part is when you combine them: You have a name of a time (an appointment) and you want to correlate that with a point in time to match with someone else's calendar. The only way to do that is store the datetime plus the name of the timezone area (not the offset, the name).
- URSpider94 15y agoThe author's point is that even that is not enough, if the rules of the timezone change between when you enter the event into the database and when the event arrives.