这是我的方法
def get_remaining_days_in_financial_month(self, from_day):
current_financial_day = date(from_day.year, from_day.month,
self.financial_day_of_month)
end_financial_month = current_financial_day + relativedelta(months=+1)
delta = relativedelta(end_financial_month, from_day)
remaining_days_in_financial_month = delta.days
return remaining_days_in_financial_month
当我调试时,我看到
current_financial_day = 2013-06-01
delta = relativedelta(months=+1)
end_financial_month = 2013-07-01
from_day = 2013-06-01
remaining_days_in_financial_month = 0
尽管此信息是正确的,但我想知道 的数量days
,因为天数从28
2 月变为30
6 月和31
8 月
我怎样才能做到这一点?dateutil库似乎没有提供一种方式
谢谢