You are viewing one comment and its replies. View all comments
It depends on the database. But it’s common practice to store values in UTC, which doesn’t have DST, and only display in the user’s timezone. What you saw was probaby only a bug on the front end, but not database corruption.
Or just Unix (epoch) time.
https://en.wikipedia.org/wiki/Unix_time
There can be problems with leap seconds using UTC (or leap hours eventually)
https://en.wikipedia.org/wiki/Leap_second
They decided to stop doing leap seconds.
Until they decide to reverse it, or until they make a different change.
Just use Epoch time for backend and calculations, and use local time for displaying to the user (or UTC for debugging systems that span time zones)
Sign in to comment. Sign in
Comments
It depends on the database. But it’s common practice to store values in UTC, which doesn’t have DST, and only display in the user’s timezone. What you saw was probaby only a bug on the front end, but not database corruption.
Or just Unix (epoch) time.
https://en.wikipedia.org/wiki/Unix_time
There can be problems with leap seconds using UTC (or leap hours eventually)
https://en.wikipedia.org/wiki/Leap_second
They decided to stop doing leap seconds.
Until they decide to reverse it, or until they make a different change.
Just use Epoch time for backend and calculations, and use local time for displaying to the user (or UTC for debugging systems that span time zones)
Sign in to comment. Sign in