Page MenuHomePhabricator

Timestamps off by an hour (timezone) in diffs when being logged out
Open, Needs TriagePublicBUG REPORT

Description

At least the german wikipedia shows different times for logged in users and for those not logged in. There seems to be something odd with daylight savings.

When you look at the following link when not logged you see a different time compared to logged in and correct time zone (Europe/Berlin):

Look at the heading on the left side of the diff:
https://de.wikipedia.org/w/index.php?title=Darwin_Mounds&diff=175806499&oldid=148646282

Now, during daylight saving time, the previous version shows a time of "8:33" when not logged in. But when you are logged in, you see "7:33".

The database holds a value of "20151202063312" in revision.rev_timestamp. Germany (and the other german speakers in Switzerland, Austria, Liechtenstein) have UTC+1 in winter and UTC+2 during daylight saving, so the hour "06" is as expected and "7:33" for logged in users is okay too.

Note: The right side of the diff is (currently) okay, IPs and logged in users see the same time. This may change during winter without daylight savings.
Note 2: The left side has a time without daylight savings, the right side is during daylight savings.

New accounts with no change in the settings are like IPs, they show the wrong time too.

Since all german speaker (except for a few minorities) live in the same time zone "Europe/Berlin", I expect the same times when logged in and when not logged in.

Event Timeline

Aklapper changed the task status from Open to Stalled.May 25 2022, 11:05 AM

At least the german wikipedia shows different times for logged in users and for those not logged in.

Cannot reproduce on a system set to CEST timezone. What is your system time and timezone set to?

Screenshot from 2022-05-25 13-01-46.png (474×1 px, 150 KB)

Screenshot from 2022-05-25 13-01-49.png (407×1 px, 153 KB)

I have Linux and in /etc/sysconfig/clock I readTIMEZONE="Europe/Berlin"

Env. Variable TZ LC_TIME* or TIMEZONE is not set.

On tools-sgebastion-10 wget -O - -q "https://de.wikipedia.org/w/index.php?title=Darwin_Mounds&diff=175806499&oldid=148646282" | grep ":33" shows 8:33 too, so it smells it is not my local system

If you open the "Developer Tools > Console" on a non-Wikimedia page in your browser and enter

(new Date()).toLocaleString("en-US",{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:false,timeZoneName:"long"});

What is the output?

In case you use Firefox, is privacy.resistFingerprinting maybe enabled?

I can confirm the problem with the latest Google Chrome and the latest Firefox on Windows 10.

Firefox: Output is: "Wednesday, May 25, 2022, 15:01:39 Central European Summer Time"

privacy.resistFingerprinting = false

I tried this one with chrome and no login:

TZ=EST5EDT TIMEZONE=EST5EDT chromium "https://de.wikipedia.org/w/index.php?title=Darwin_Mounds&diff=175806499&oldid=148646282"
and in the Chrome-console I see: 'Wednesday, May 25, 2022, 09:13:34 Eastern Daylight Time' so it uses EST5EDT (according to the manuals the default)

However, when I am not logged in I see 8:33 which is one hour off to the correct 7:33

Same behaviour with
TZ=CET TIMEZONE=CET chromium "https://de.wikipedia.org/w/index.php?title=Darwin_Mounds&diff=175806499&oldid=148646282"
'Wednesday, May 25, 2022, 15:19:11 GMT+02:00'

And again 8:33 when not logged in.

Aklapper renamed this task from Default timezone / Default daylight saving for de-wikipedia to Incorrect timezone when being logged out and using Chrome.May 25 2022, 1:28 PM

Every browser, not only chrome! Even Lynx shows the same behaviour, the original report was based on Firefox.

Aklapper renamed this task from Incorrect timezone when being logged out and using Chrome to Timestamps off by an hour (timezone) in diffs when being logged out.May 25 2022, 1:40 PM

However, when I am not logged in I see 8:33 which is one hour off to the correct 7:33

In that case I'm afraid that this has nothing to do with Wikimedia servers but with stuff on the local system...

Still cannot reproduce neither with chromium-102.0.5005.61 nor firefox-100.0.2 on Fedora Linux on mediawiki.org: Both being logged in and logged out shows expected output in CEST (my current timezone).

It even happens in the labs environment ("tools-sgebastion") as shown above by Wurgl - it is no "local system" problem for sure.

Please replace "local system" with "browser software" in that case.

I just tried it with Google Chrome, with Brave, with Firefox, with Microsoft Edge and even with the Internet Explorer on a bog-standard Windows 10 PC. I tried it with Google Chrome on a Windows 10 Laptop and I tried it on two different Linux machines using wget. The problem was visible in every single test.

When you have a new created account (or when you never changed your settings of the timezone), you will see the same information as not logged in with one hour off for the other half of the year.

Once you set your timezone explicitly to e.g. Europe/Berlin, you will see the different times compared to not logged in.

However: for my example above: https://de.wikipedia.org/w/index.php?title=Darwin_Mounds&diff=175806499&oldid=148646282

$ sql de
MariaDB [dewiki_p]> select rev_timestamp from revision where rev_id in (175806499, 148646282);
+----------------+
| rev_timestamp  |
+----------------+
| 20151202063312 |
| 20180405153436 |
+----------------+

the first one shows an UTC-Hour of 6, the second hour is 15. The first one is has no daylight saving, since in december, the second one has daylight saving since in april. So in december I expect one hour off, whereas in April I expect is two hour difference.

I see not logged in "2. Dezember 2015, 08:33 Uhr" vs. "5. April 2018, 17:34 Uhr", so both show 2 hours offset.

Same on tools-sgebastion-10 with wget:
wget -O - -q "https://de.wikipedia.org/w/index.php?title=Darwin_Mounds&diff=175806499&oldid=148646282" | egrep ":33|:34"

"2. Dezember 2015, 08:33 Uhr" and "5. April 2018, 17:34 Uhr"

Again both with two hours offset.

So when you are not logged in (or with an account where you never changed the timezone settings) the daylight saving is simple ignored.

Aklapper reopened this task as Open.EditedJun 6 2022, 7:59 PM

Thanks for the additional info. I had interpreted this ticket as "The times differ" and I could not reproduce; looks like in my case they are simply always off.

For the records, I get 08:33 and 17:34 in all and any cases here locally for wget -O - -q "https://de.wikipedia.org/w/index.php?title=Darwin_Mounds&diff=175806499&oldid=148646282" | egrep ":33|:34", and locally I am

$:acko\> timedatectl
               Local time: Mon 2022-06-06 21:53:36 CEST
           Universal time: Mon 2022-06-06 19:53:36 UTC
                 RTC time: Mon 2022-06-06 21:53:36
                Time zone: Europe/Berlin (CEST, +0200)

I think(!) the reason is some default value
https://de.wikipedia.org/w/api.php?action=query&format=json&meta=userinfo&ascii=1&formatversion=2&uiprop=options

This returns when logged in as Wurgl (with correct times) the following line "timecorrection": "ZoneInfo|120|Europe/Berlin",

When not logged in (or when I never changed the timezone, like in the Bot-Account APPERbot) I see "timecorrection": "System|120",