Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
991 Переглядів

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'

Аватар
Відмінити
Найкраща відповідь

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.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
січ. 25
579
4
квіт. 24
2110
1
квіт. 24
1504
name '_' is not defined Вирішено
5
квіт. 24
2125
1
черв. 23
6921