代码如下:
#encoding=utf-8
print '中国'
#计算日期之间的工作日,不是天数
from dateutil import rrule
import datetime
def workdays(start, end, holidays=0, days_off=None):
if days_off is None:
days_off = 5,6
workdays = [x for x in range(7) if x not in days_off]
days = rrule.rrule(rrule.DAILY, dtstart=start, until=end,byweekday=workdays)
return days.count() - holidays
print workdays(datetime.date(2014,3,1),datetime.date(2014,3,23),0)
中国
15