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
- [Answered ]-{{ form.non_field_errors }} with django-crispy-forms
- [Answered ]-Rounding a timedelta to the nearest 15 minutes
- [Answered ]-Django 404 Page not loading
- [Answered ]-Django channels and docker-compose error
Source:stackexchange.com