Opened 5 years ago

Closed 3 years ago

Last modified 18 months ago

#17262 closed Cleanup/optimization (fixed)

Refactor the implementations of tzinfo classes

Reported by: aaugustin Owned by: aaugustin
Component: Utilities Version: 1.4
Severity: Normal Keywords: timezone tzinfo
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Since the merge of the time zone support branch, django.utils.tzinfo and django.utils.timezone provide subtly different implementations of a tzinfo subclass representing local time.

The reason is explained at the bottom of this message. In short, the former is used for display and focuses on robustness; the latter is used for time zone support and focuses on correctness.

I think django.utils.tzinfo should be refactored and merged into django.utils.timezone, but that's probably not doable in a totally backwards-compatible fashion.

Change History (7)

comment:1 Changed 5 years ago by ptone

  • Keywords timezone tzinfo added
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by aaugustin

See also #18766.

comment:3 Changed 3 years ago by aaugustin

  • Component changed from Core (Other) to Utilities

comment:4 Changed 3 years ago by aaugustin

  • Has patch set
  • Version set to 1.4

Pull request:


I'll merge this in a few days, unless the discussion on django-developers reveals some good reasons not to.

comment:5 Changed 3 years ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from new to closed

In ec2778b445546f624d3b3a1f2118e751b10bb2e7:

Fixed #17262 -- Refactored tzinfo implementations.

This commit deprecates django.utils.tzinfo in favor of the more recent
django.utils.timezone which was introduced when Django gained support
for time zones.

comment:6 Changed 3 years ago by Aymeric Augustin <aymeric.augustin@…>

In d9413d33b2a8371731a92289123683cf6f440290:

Refactored code and tests that relied on django.utils.tzinfo.

Refs #17262.

comment:7 Changed 18 months ago by Tim Graham <timograham@…>

In 1b0365ad34151f266fe3faecb4edf31a51a8642c:

Removed django.utils.tzinfo per deprecation timeline; refs #17262.

Note: See TracTickets for help on using tickets.
Back to Top