[Answered ]-Django Queryset filter datetimefield using time interval

1👍

You can try this:

Sample.objects.filter(
    created_at__time__gte='13:00', created_at__time__lte='15:00'
)

0👍

I think it is better to divide this DateTime field to DateField and TimeField (both support auto_now parameters), so it will be easier.

Leave a comment