Use time-zone-aware timestamps (USE_TZ=True) [Tracking]

NEW
Unassigned

Status

developer.mozilla.org
General
11 months ago
5 months ago

People

(Reporter: jwhitlock, Unassigned)

Tracking

(Depends on: 1 bug, Blocks: 2 bugs, {in-triage})

Details

(Whiteboard: [specification][type:change])

(Reporter)

Description

11 months ago
What feature should be changed? Please provide the URL of the feature if possible.
==================================================================================
Timestamps in Kuma are "naive", with no timezone but implied to be in US/Pacific, with the Django settings USE_TZ=False (default). This should be changed:

- Use USE_TZ=True in Django
- Store time-zone-aware timestamps in the database

What problems would this solve?
===============================
Django attempts to interpret naive timestamps but some, especially around daylight savings time transitions, are ambiguous, leading to errors (bug 1173189).

It is harder to display dates in the user's timezone, if desired (bug 1189477).

For new projects, Django recommended USE_TZ=True, so that the data is good from the start.

Who would use this?
===================
MDN visitors and developers

What would users see?
=====================
Consistent dates. We may even be able to display timestamps in the user's local timezone.

Developers would get less warning emails around daylight savings time transitions.

What would users do? What would happen as a result?
===================================================
Developers would rest well at night, knowing each second is being counted correctly.

Is there anything else we should know?
======================================
This will require many steps:

- Expand Django tests to add time-zone-aware testing in parallel w/ current naive timestamps
- Update Kuma to work correctly with both kinds of timestamps
- Convert database to use time-zone-aware timestamps (could be done w/ transition to PostgreSQL, or with manual MySQL migration).

This replaces bug 1142203, which is marked employee confidential, and is now focused on the database tasks.

Previous work in PR mozilla/kuma#3334, https://github.com/mozilla/kuma/tree/bug1142203
(Reporter)

Updated

11 months ago
Depends on: 1142203
(Reporter)

Updated

11 months ago
Summary: Use time-zone-aware timestamps (USE_TZ=True) → Use time-zone-aware timestamps (USE_TZ=True) [Tracking]
(Reporter)

Updated

11 months ago
No longer blocks: 1189477
Depends on: 1189477
(Reporter)

Updated

11 months ago
Blocks: 1189477
No longer depends on: 1189477
Keywords: in-triage
(Reporter)

Updated

5 months ago
No longer blocks: 1221396
See Also: → bug 1221396
You need to log in before you can comment on or make changes to this bug.