bnjbvr / rustatouille

Rustatouille is a page status system!
Apache License 2.0
3 stars 1 forks source link

Time zones :upside_down_face: #21

Open bnjbvr opened 1 year ago

bnjbvr commented 1 year ago

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.

bnjbvr commented 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?

Flaburgan commented 1 year ago

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 ;)

bnjbvr commented 1 year ago

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!

ldidry commented 1 year ago

As Rustatouille should create a static cache, client-side time adaptation is needed, indeed 🙂