[Answered ]-Why does django date filter gives me entries from the next day as welll

2👍

According to the Django QuerySet reference for date:

When USE_TZ is True, fields are converted to the current time zone before filtering.

Given that both the tasks occur shortly after midnight, I suspect that the conversion to your set timezone is causing the issue you are seeing.

0👍

I know it’s an horrible workaround, but it worked for me. Disable USE_TZ and enable back again after the query is done:

from django.conf import settings
    settings.USE_TZ = False
    .... [query]
    settings.USE_TZ = True

Leave a comment