News for hackers. Stuff that matters.
Re:Storing Date/Times in Databases by Tharkun on Monday May 14, 2012 @08:34AM (#3970750)
You have to make the distinction between absolute time and relative time. You use relative time for appointments/calendars and any other kind of "people oriented" time. Absolute time is everything else.

Relative time is a sticky mess. I think The Doctor referred to it as wibbly wobby timey wimey stuff -- and it really is. Just store this crap as a string along with the user's location. Don't bother storing the timezone, because DST changes every other day and some retard or another is always adding/removing timezones. When it comes to appointments and the like, you only ever have to bother with conversions when sharing it with users in a different location/timezone. That's when you perform the relevant magic. Not before. Not ever.

When it comes to absolute time, things are lot easier. Use UTC. Always. No exceptions. 'nuff said.

There are no comments on this comment yet.