Open Bug 1627998 Opened 10 months ago Updated 8 months ago

[Protections Report] daily statistics are calculated in UTC+0 timezone, instead of the local one


(Firefox :: Protections UI, defect, P3)





(Reporter: mstanke, Unassigned)


A user reported that the protections report shown on about:protections is calculated using wrong timezone. Being in UTC+2 (CEST), everything up to 2:00 AM is still included into the previous day.

Being a developer (tough not Firefox contributor), I would estimate the stats are recorded and computed with hardcoded UTC+0 time zone, instead of the local timezone or the actual time on the machine at the time of visiting the websites.

I'll have to take a look at the code again to see if anything is wrong with it. For the protection report, we do not care the hour the tracker is recorded, only the day. Because of this, we record all days in the database as if they are in UTC at exactly noon, the theory is that at noon in UTC most places on earth are in the same day. Unfortunately this does not account for any daylight savings time changes and it is never the same day everywhere in the world. There is always an exception in the timezones directly to the west of the date line. We should rethink this.

The other thing a user may notice, is that the trackers get added to the database when the page closes, not at the moment the trackers are being blocked. This is because new trackers may be blocked as the user spends time on the page. So if a user opens a page yesterday, but closes it today it will be recorded as today.

The priority flag is not set for this bug.
:ewright, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ewright)

This graph is going through a redesign at the moment, so I'll wait to see how that turns out.

Flags: needinfo?(ewright)
Priority: -- → P3

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.