3 ms·
> I suppose using Unix time for dates in the far future isn't a good idea. I guess I'll file that away. Not just Unix time, converting future local time to UTC
by growse 2y ago
> I suppose using Unix time for dates in the far future isn't a good idea. I guess I'll file that away.
Not just Unix time, converting future local time to UTC and storing that is also fraught with risk, as there's no guarantee that the conversion you apply today will be the same as the one that needs to be applied in the future.
Often (for future dates), the right thing to do is to store the thing you were provided (e.g. a local timestamp + the asserted local timezone) and then convert when you need to.
(Past dates have fewer problems converting to UTC, because we don't tend to retroactively change the meaning of timezones).