i am using this template tags on my project
{% load tz %}
{% get_current_timezone as TIME_ZONE %}
{% timezone TIME_ZONE %}
...
{% endtimezone %}
it is raising this error when TIME_ZONE
suplied with Etc/GMT-3
value.
File "/usr/local/lib/python3.10/site-packages/django/utils/timezone.py", line 133, in activate
_active.value = zoneinfo.ZoneInfo(timezone)
File "/usr/local/lib/python3.10/zoneinfo/_common.py", line 24, in load_tzdata
raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key +03'
i see in my current django library it use the following function when timezone tag is called.
this is in env/lib/python3.9/site-packages/django/utils/timezone.py
.
def _get_timezone_name(timezone):
"""
Return the offset for fixed offset timezones, or the name of timezone if
not set.
"""
return timezone.tzname(None) or str(timezone)
the function return +03
when supplied with Etc/GMT-3
timezone, then it giving me above error. is it a bug?
anyway, i need to create my own tag because of it.