阅读背景:

python中有效的日期范围重叠计算?

来源:互联网 

I have two date ranges where each range is determined by a start and end date (obviously, datetime.date() instances). The two ranges can overlap or not. I need the number of days of the overlap. Of course I can pre-fill two sets with all dates within both ranges and the perform a set intersection but this is possibly inefficient...is there a better way apart from another solution using a long if-elif section covering all cases ?I have two date ranges where each range is dete




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: