Skip to Content
Menu
This question has been flagged
1 Reply
1759 Views

Whenever I'm commiting my code, I get this UnknownTimeZoneError: 'Europe/Kyiv'. If anyone knows whats the problem it would be great!


Traceback (most recent call last):

File "/home/odoo/src/odoo/odoo/addons/base/tests/test_tz.py", line 31, in test_tz_legacy

assertTZEqual(pytz.timezone(source), pytz.timezone(target))

File "/home/odoo/src/odoo/odoo/tools/_monkeypatches_pytz.py", line 129, in timezone

return original_pytz_timezone(name)

File "/usr/lib/python3/dist-packages/pytz/__init__.py", line 188, in timezone

raise UnknownTimeZoneError(zone)

pytz.exceptions.UnknownTimeZoneError: 'Europe/Kyiv'

Avatar
Discard
Best Answer

Hello Shrut Pansuriya,

You can execute following script to list of available timezone.

with open(r'pytz_all_timezones.txt', 'w') as fp:
    for item in pytz.all_timezones:
        # write each item on a new line
        fp.write(f"{item}\n")

In your terminal go to specific folder, execute cmd python3.

type, import pytz

then write above script. It will create file of available timezone. 


You are facing this error because the timezone which you are trying to enter its not available in this library.

Avatar
Discard
Related Posts Replies Views Activity
0
Jan 25
1148
4
Apr 24
3061
1
Apr 24
2305
5
Apr 24
2916
1
Jun 23
8003