[Solved]-Invalid Django TIME_ZONE

32👍

According to the error message:

ValueError: Incorrect timezone
setting: America/New_York EST5EDT
SystemV/EST5EDT US/Eastern

it seems that TIME_ZONE, in settings.py, is equal to : America/New_York EST5EDT SystemV/EST5EDT US/Eastern

You must write only America/New_York.

If it’s not the case, check for the existence of the file:

/usr/share/zoneinfo/America/New_York

if it’s absent, that time zone is invalid on your system.

(valid time zones are in /usr/share/zoneinfo/)

👤manji

0👍

I got the error below. *I use Django 4.2.1:

zoneinfo._common.ZoneInfoNotFoundError: ‘No time zone found with key America/NewYork’

Because I set 'America/NewYork' to TIME_ZONE as shown below:

# "settings.py"

TIME_ZONE = 'America/NewYork'

So, I set 'America/New_York' to TIME_ZONE as shown below, then the error was solved:

# "settings.py"
                      # ↓ "_" is added
TIME_ZONE = 'America/New_York'

Leave a comment