diff options
| author | Carlton Gibson <carlton.gibson@noumenal.es> | 2021-08-24 11:21:32 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-08-30 10:46:19 +0200 |
| commit | fe3a854e1de2753ad6fa78a8584f85186092f801 (patch) | |
| tree | 8f51a1f5262e8473f40f6fe199bec755f802747b /django | |
| parent | 382374a360d31f0243dc3075ccea29c448b0a2bc (diff) | |
[3.2.x] Fixed #32992 -- Restored offset extraction for fixed offset timezones.
Regression in 10d126198434810529e0220b0c6896ed64ca0e88.
Backport of cbba49971bbbbe3e8c6685e4ce6ab87b1187ae87 from main
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/timezone.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/utils/timezone.py b/django/utils/timezone.py index cf22ec34d0..77b537e17c 100644 --- a/django/utils/timezone.py +++ b/django/utils/timezone.py @@ -72,8 +72,11 @@ def get_current_timezone_name(): def _get_timezone_name(timezone): - """Return the name of ``timezone``.""" - return str(timezone) + """ + Return the offset for fixed offset timezones, or the name of timezone if + not set. + """ + return timezone.tzname(None) or str(timezone) # Timezone selection functions. |
