django database connection isn't set to UTC postgresql

Step 1: Modify Django settings.py file In the settings.py file of your Django project, locate the 'DATABASES' configuration section.

Step 2: Adjust database settings Within the 'DATABASES' section, find the configuration for the PostgreSQL database. Set the 'TIME_ZONE' parameter to 'UTC' to ensure that Django uses Coordinated Universal Time (UTC) for database connections.

For example:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'your_db_name',
        'USER': 'your_db_user',
        'PASSWORD': 'your_db_password',
        'HOST': 'your_db_host',
        'PORT': 'your_db_port',
        'OPTIONS': {
            'options': '-c timezone=UTC',
        },
    }
}

Step 3: Restart Django server After making changes to the settings.py file, restart your Django server to apply the modifications.

This adjustment ensures that Django establishes connections to the PostgreSQL database using the UTC timezone.