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


11 months ago
5 months ago


(Reporter: jwhitlock, Unassigned)


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


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



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,


11 months ago
Depends on: 1142203


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


11 months ago
No longer blocks: 1189477
Depends on: 1189477


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


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.