Open bnjbvr opened 1 year ago
I think the best would be:
The nice thing is that this would require only minimal changes to the server, that I'm willing to do (when we return date values to the client, send them as a raw number e.g. unix timestamp).
@Flaburgan Does it make sense? Would you be up to implementing that?
I always only stored dates in UTC in databases. Then, should the conversion to local date for the user should be done server side while rendering the page or client side with some JS, up to you ;)
In my experience there's no way to get a preferred language or time zone just by inspecting regular headers, so I'd say client side please!
As Rustatouille should create a static cache, client-side time adaptation is needed, indeed 🙂
Which time zone should be the reference? Should the admin be able to configure one for the server, and use that as a reference? We can store dates in UTC in the database, but then when displaying them, we need to decide what a good time zone is. Alternatively we could make use of some client-side JS to convert the UTC timezone to the user's local time zone, to display it nicely for them.