Search code examples
djangodjango-timezone

I want to change UTC time zone to Pakistan time zone in Django 4.1.2


This is my code below and it is not working

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/Pakistan'

USE_I18N = True

USE_L10N = True

USE_TZ = True

it is giving me this error

A server error occurred.  Please contact the administrator.

Solution

  • I think you don't need to add Country Name.

    Instead of this:

    TIME_ZONE = 'Asia/Pakistan'
    

    Try this:

    TIME_ZONE = 'Asia/Add here city name with first letter capital'
    

    For example:

    Here in india, we need to add city name.

    TIME_ZONE = 'Asia/Kolkata' #Added a city name here for india