[Django] #33663: Timezones with hyphens in name fail in Extract() functions.

3 views
Skip to first unread message

Django

unread,
Apr 27, 2022, 12:38:55 AM4/27/22
to django-...@googlegroups.com
#33663: Timezones with hyphens in name fail in Extract() functions.
-----------------------------------------+------------------------
Reporter: spetoolio | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
{{{
local_tz = pytz.timezone(""Asia/Ust-Nera")
Model.objects.annotate(
created_at_month=ExtractMonth('created_at', tzinfo=local_tz)
)
}}}

Fails with:


{{{
DataError: time zone "Asia/Ust+Nera" not recognized
}}}

I have confirmed this fails with other timezones with hyphens, such as
"America/Port-au-Prince".

I have also confirmed my postgresql DB supports these timezones:

{{{
SELECT
name,
abbrev,
utc_offset,
is_dst
FROM pg_timezone_names
WHERE name !~ 'posix'
ORDER BY name asc;
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33663>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 27, 2022, 2:51:20 AM4/27/22
to django-...@googlegroups.com
#33663: Timezones with hyphens in name fail in Extract() functions.
-------------------------------------+-------------------------------------
Reporter: Doug Franklin | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate
* component: Uncategorized => Database layer (models, ORM)
* type: Uncategorized => Bug


Comment:

Duplicate of #33279.

--
Ticket URL: <https://code.djangoproject.com/ticket/33663#comment:1>

Reply all
Reply to author
Forward
0 new messages