这真的不应该这么难,但由于某种原因,我似乎无法理解。
我正在尝试对我的查询运行一个过滤器,比较今天和明年第一天之间的日期范围。
得到今天是没有问题的,但我似乎无法得到明年的第一天。我希望能够为自己提供 2013 年 1 月 1 日
到目前为止,这是我的过滤器:
cur_il = Investment.objects.all().filter(plan = plan).order_by('financial_institution').filter(maturity_date__range=[now, nextyear])
显然我用它来获取今天的日期:
now = datetime.now()
我怎样才能得到下一个日期?