python 日期计算相关
引入:
from datetime import datetime,date,timedelta
最常见与YYYYMMDD格式字符串日期的相关计算
today:
today = datetime.now()
str_today = today.strftime('%Y%m%d')
nextday:
nextday = datetime.strptime(str_today,'%Y%m%d') + timedelta( days = 1)
str_nextday = nextday.strftime('%Y%m%d')

浙公网安备 33010602011771号