how to set indian timezone in django
Open your Django project's settings.py file.
Locate the
TIME_ZONE
setting in the file.Change the
TIME_ZONE
setting to 'Asia/Kolkata' to set the Indian time zone. The updated line should look like this:
python
TIME_ZONE = 'Asia/Kolkata'
- Additionally, you can set the
USE_TZ
setting toTrue
if it's not already set. This ensures that Django uses time zone-aware datetimes.
python
USE_TZ = True
Save the changes to the settings.py file.
Restart your Django development server to apply the changes.
Now, your Django project is configured to use the Indian time zone.