widelands / widelands-website

The widelands website is a bunch of applications for the django web framework. It is developed in the open here.
https://www.widelands.org/
GNU General Public License v2.0
15 stars 11 forks source link

DST Website Timestamps Off One Hour #421

Open Noordfrees opened 1 year ago

Noordfrees commented 1 year ago

Since the daylight saving time came active, all timestamps in the website are off by one hour for me: For example, a PM that arrived at 19:58 real time (as listed correctly in my e-mail) is shown in the list of PMs to have arrived at 20:58.

I'm in the German time zone with summertime (CEST, UTC+2). "UTC +02" is also what my profile page shows (I always have the checkbox to use the browser timezone on login active). Maybe the website applies the DST shift on top of a timezone that already accounts for DST?

Using Firefox 102.9.0esr on Debian Unstable

frankystone commented 1 year ago

I'll look into this... Damn time

Noordfrees commented 1 year ago

:( Just noticed there's still (or newly) a similar problem: timestamps are shown correctly while logged in (with the checkbox to save the browser's time as profile time active) but are shown one hour off from the local time while not logged in. Example: this post was done by me at 8:58 CEST, and when logged in it shows grafik and when logged out it shows as grafik

frankystone commented 1 year ago

It is not possible (without much effort) to estimate the time zone of a not logged in user. To accomplish this we have to use IP-address databases to find out which IP-address is in which time zone. Because this is privacy related we shouldn't do that imho. Moreover this is vague anyway, because if the user is behind a proxy the IP-address might looks like the user is sitting in the USA although the real user is sitting japan.

Noordfrees commented 1 year ago

But the login page already determines the user's time zone somehow for the "Looks your time zone is UTC +2.00" checkbox, so why can't we use that?

frankystone commented 1 year ago

Yes, probably we can use the same determination of the time zone for all users. For the login page we use javascript, but if a user has disabled javascript it does not work: login_without_java

AFAIK there is no method to get a users correct time zone under all circumstances.

A solution might be to use the javascript snippet also for not logged in users and for users who disabled javascript we just add UTC to each time display, e.g. for your example it shows then Postet at today 6:58 UTC