In my django project's settings.py
file, I have this line :
TIME_ZONE = 'UTC'
But I want my app to run in UTC+2 timezone, so I changed it to
TIME_ZONE = 'UTC+2'
It gives the error ValueError: Incorrect timezone setting: UTC+2
. What is the correct way of doing this?
Thanks!
To get a set of all valid timezone names (ids) from the tz database, you could use
pytz
module in Python:Choose a valid timezone from the tzinfo database. They tend to take the form e.g.
Africa/Gaborne
andUS/Eastern
Find the one which matches the city nearest you, or the one which has your timezone, then set your value of
TIME_ZONE
to match.I found this question looking to change the timezone in my Django project's
settings.py
file to the United Kingdom.Using the tz database in jfs' solution I found the answer:
Here is the list of valid timezones:
http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
You can use
for UTC+02:00