I have this table which has column "date" in the format "2021-03-12 08:12:44.350176". I want to compare a external date such as "2021-03-12 08:12:44"
I have tried this
new_date = datetime.datetime(2021, 3, 12, 8, 12, 44, tzinfo=<UTC>)
obj = Test.objects.filter(date__contains=new_date).all()
But it doesn't work, it returns empty sets. My goal is to fetch all the records against the new_date.
Is there a way to remove milliseconds or way to compare the two dates?