python计算两个日期相差的天数
#两个日期相隔多少天,例:2008-10-03和2008-10-01是相隔两天 def datediff(beginDate,endDate): format="%Y-%m-%d"; bd=strtodatetime(beginDate,format) ed=strtodatetime(endDate,format) oneday=datetime.timedelta(days=1) count=0 while bd!=ed: ed=ed-oneday count+=1 return count