Query datetime by today's date in Django

前端 未结 7 498
梦谈多话
梦谈多话 2021-01-31 08:16

I\'m saving datetime in the db for an object. I\'d like to query against the db and select anything from todays date, not datetime.

What\'s the

7条回答
  •  醉梦人生
    2021-01-31 08:50

    Try using the keys date__gte and date__lte. You can pass in two datetime objects marking the boundaries of what you want to match.

提交回复
热议问题