python arrow操作

昨天,时间格式YYYY-MM-DD

(datetime.datetime.now() + datetime.timedelta(days=-1)).strftime('%Y-%m-%d')

循环

start = arrow.get('2017-09-01').datetime
end = arrow.now().datetime
print start, end
for i in arrow.Arrow.span_range('month', start, end):

你可能感兴趣的:(python arrow操作)