I have the following model field:
inbound_date = models.DateTimeField()
I want to filter on date, and not care about the time. I have inserted two test objects which return the following values for inbound_date:
2018-11-14 00:00:00+00:00
2018-11-15 08:37:09+00:00
But all my attempts at retrieving the objects fail:
AppInbound.objects.filter(inbound_date__date=datetime.date(2018, 11, 15))
Or
AppInbound.objects.filter(inbound_date__date='2018-11-15')
But all seem to return an empty QuerySet. The only one I did manage to get working was:
AppInbound.objects.filter(inbound_date__startswith='2018-11-15')
Which returns the the last objects, with datetime of 2018-11-15 08:37:09+00:00.
Can someone explain what is going wrong here?
It is an MySQL database, and we have TZ enabled.