python中对日期对象的处理
作者:互联网
两篇值得看的博客:
https://www.cnblogs.com/huigebj/p/11259449.html
https://blog.csdn.net/zzddada/article/details/102822337
字符串 -> 日期
from datetime import datetime
setTime = '2015-04-16'
now = datetime.strptime(setTime, "%Y-%m-%d")
日期时间段
from datetime import timedelta
delta = datetime.timdelta(days=1) # 用来做加减日期
日期 -> 字符串
now.strptime("%Y-%m-%d")
标签:-%,python,strptime,datetime,对象,日期,https,import 来源: https://www.cnblogs.com/catfish1921/p/15229217.html