Hacker News new | past | comments | ask | show | jobs | submit login

It depends on how the data is going to be used. If you want absolute time, save it as UTC or local with an offset. But if a user is going to think of "7pm my time" then you probably are going to need to save "7pm" and the user's timezone separately so that 7pm always shows as 7pm even after Daylight Savings changes or other timezone rule changes. Save the date and time relative to the context of a timezone (not offset).

There are a lot more timezones than there are offsets, and several timezones may have the same offset at a given point in time, but that may not be true every day of the year because they have different rules.

So the robust solution is to make all your datetimes "timezone" aware, not "offset" aware. And yes that means using the Olsen Data and yes that means more complications. But it's the only way to have accuracy for human-oriented datetimes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: