I use django 3.1.0
I have a release_time field(a DateTimeFeild) in my model, and i want to retrieve those records that have been released in current date.
here is my model:
class Test(models.Model): title = models.CharField(max_length=100) release_time = models.DateTimeField() end_time = models.DateTimeField()
I use the following line to get my data:
cur_time = localtime() // django.utils.timezone.localtime Test.objects.filter(release_time__date=cur_time.date())
This always returns an empty query set. I am sure that there are records that have this condition.
PLease tell me am I doing this wrong??