|
|
|
|
|
by ptsneves
558 days ago
|
|
Can anybody explain why we should just not do what unix and gps do and use an agreed upon epoch, and let all the front ends make the conversions?
I genuinely dread human readable timestamps inside backend code and always use unix time. Even in front end adding the whole human readable time stamp takes almost 60 characters out of the logs. I often look at timestamps in human format and wonder what time zone is this, and does the computer even have a synced clock. A week ago I debugged a 2FA issue where one intervenient did not have NTP configured and the clock was off by some random 20 minutes, and thus tokens were emitted expired. |
|
Your calendar app looks up my timezone. I live in Europe, so at the 1st of August 2025 I'll be observing summer time, so I'll be using CEST - which is UTC+2:00. You convert it to the Unix timestamp 1733658933 and store that.
It is February 2025. The EU passes legislation to abolish summer time.
It is March 2025. Your app gets a timezone file update.
It is the 1st of August 2025. Your app retrieves the timestamp for the meeting, which occurs at 1733658933. You convert it to my local time. I live in Europe, so I'll be using CET, which is UTC+1:00. You convert it to the 1st of August 2025, 08:00 local time.
I am an hour early for my meeting. It is your app's fault. All timestamps converted from CEST are incorrect. You didn't store the original timezone, so you have no way to correct it. You get thousands of angry emails, and everyone abandons your app.