Hacker News new | ask | show | jobs
by outadoc 1953 days ago
Not true. Say you want to save an event that you know will happen on the 14th of July at 15:00 Paris time, in the year 2025. Current time zone rules tells you this will be at 13:00 UTC. Well, if France decides to abolish DST and stick to standard time before then, you'll be wrong.
2 comments

No, they won't be wrong, because the TZ database includes historical data & will know that DST was still in effect at the time you saved the timestamp.

[Ed. Nevermind, sorry, I see you're referring to a future point. My bad. You're right.]

For that use case definitely, though a law change is a bit of an edge case.

For stamping times like in a log though UTC should always be used server side.

Sure! But my point is there's no one true way to do it and you always have to think about what you're trying to represent and how you're going to use it.

Also, I would argue time manipulation is full of many "edge cases" like this one, which is why it's so hard. It's going to work fine until it doesn't.