How to set the timezone in Django?

后端 未结 8 883
萌比男神i
萌比男神i 2020-11-29 19:33

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, s

8条回答
  •  無奈伤痛
    2020-11-29 20:19

    Choose a valid timezone from the tzinfo database. They tend to take the form e.g. Africa/Gaborne and US/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.

提交回复
热议问题