datetime中strftime和strptime用法

from datetime import *
format = "%Y-%m-%d %H:%M:%S"
a=datetime.now()
day=a.day
b=a.replace(day=day+1)
s=b.strftime(format)#datetime类型转化成 string类型
expire_time=datetime.strptime(s, format)#string类型转化成datetime类型
now = datetime.now()
if now<expire_time:
return True
上一篇:C与CPP 在线手册查找


下一篇:I.MX6 linux tslib Corrupt calibration data