Hacker News new | ask | show | jobs
by NelsonMinar 5069 days ago
Javascript relative time displays have hilarious results if the web browser's clock is set incorrectly. That's mostly not a modern problem thanks to NTP being baked into modern consumer OSes but it can be terribly confusing if you have a misconfigured client.
1 comments

The simple solution to this is that the server sends a reference time along with the timestamps: when the page loads you calculate the drift from the local time to the reference time, and then adjust local time to server time when you update relative timestamps.