我住在孟加拉国吉大港,我的时区是 GMT+6。如何在 Django 设置中更改到这个时区?
最佳答案
您可以将时区指定为 'Asia/Dhaka'
在 TIME_ZONE
setting [Django-doc] :
# settings.py
TIME_ZONE = 'Asia/Dhaka'
# …
请注意,如果
USE_TZ
setting [Django-doc]设置为 True
, 然后:When
USE_TZ
isTrue
, this is the default time zone that Django will use to display datetimes in templates and to interpret datetimes entered in forms.
关于python - 如何在 Django 中设置我自己的时区?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61147405/