pythondjangotimezonedjango-settings

How do I setup my own time zone in Django?


I live in Chittagong, Bangladesh and my time zone is GMT+6. How can i change to this time zone in Django settings?


Solution

  • You can specify the timezone as 'Asia/Dhaka' in the TIME_ZONE setting [Django-doc]:

    # settings.py
    
    TIME_ZONE = 'Asia/Dhaka'
    # …

    Note that if USE_TZ setting [Django-doc] is set to True, then:

    When USE_TZ is True, this is the default time zone that Django will use to display datetimes in templates and to interpret datetimes entered in forms.