#encoding:utf-8
from datetime import date, datetime, timedeltaday = date.today()
now = datetime.now()delta = timedelta(days=5)n_days_after = now + deltan_days_forward = now - deltaprint(("当前日期:{}").format(day))print("向后推迟5天的日期:{}".format(n_days_after.strftime('%Y-%m-%d')))print("向前推5天的日期:{}".format(n_days_forward.strftime('%Y-%m-%d'))) posted on 2018-10-27 21:38 阅读( ...) 评论( ...)