Home > database >  I want to change UTC time zone to Pakistan time zone in Django 4..1.2, can anybody help me?
I want to change UTC time zone to Pakistan time zone in Django 4..1.2, can anybody help me?

Time:11-18

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.

CodePudding user response:

The default time zone for Pakistan is calculated on Karachi, so instead of TIME_ZONE = 'Asia/Pakistan':

TIME_ZONE = "Asia/Karachi"

List of standard Timezone list

CodePudding user response:

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
  • Related