python 日期循环
import datetime start='2016-06-01' end='2017-01-01' datestart=datetime.datetime.strptime(start,'%Y-%m-%d') dateend=datetime.datetime.strptime(end,'%Y-%m-%d') while datestart<dateend: datestart+=datetime.timedelta(days=1) print datestart.strftime('%Y-%m-%d')
- 上一篇 »python将字符串转化为日期
- 下一篇 »python基础之循环与迭代器