Skip to content
All lessons

Tech Insights

The Django lookup date will convert the field to the TIME_ZONE setting if USE_TZ = True before get the date and compare...

The Django lookup date will convert the field to the TIME_ZONE setting if USE_TZ = True before get the date and compare. So be careful when you get a date from the DB, which it's in UTC, and do something like:

date_in_utc = Author.objects.first().created.date()
posts = Post.objects.filter(created__date=date_in_utc)

Shared by

  • Django
  • Timezone

Book a call

Lessons like this one
shape how we build.

Tell us what you’re building. In one call, we’ll show you how our team would approach it.

Tell us what you’re building, and we’ll show you how we’d approach it.

Still prefer the good old email? Contact us