How else can I write a timestamp with timezone in postgresql/django python shell?

Viewed 105

I am working on a django API project with a postgres db. I have also added a serializers.py file. I am trying to test what I've done by adding a row to the db via python shell but I keep getting this error:

django.db.utils.ProgrammingError: column "date_created" is of type timestamp with time zone but expression is of type time without time zone
LINE 1: ...bility" = NULL, "rating" = NULL, "date_created" = '00:00:00'...
                                                            ^
HINT:  You will need to rewrite or cast the expression.

This is the code:

from vendor.models import Vendors
from vendor.serializers import VendorsRegisterSerializer
p  = Vendors(id=1, first_name='Flavio', last_name='Akin', email='sheeku@gmail.com', profession='plumber', username='Flanne', pin='1234', phone_number='12345678901', number_of_jobs=300, number_of_patrons=788, date_created='21:00:00 +05:00')

I have tried replacing date_created value '21:00:00 +05:00' with '21:00:00 EST', '21:00+05' and '21:00:00+05' but I keep getting the same error.

Any help will be appreciated. Thanks in advance.

0 Answers
Related