Python中timedelta 函数使用

首先导入  from datetime import datedelta

timedelta()  参数可以有多个  days ,seconds  

timedelta(days=1)  将1天格式化为可计算时间  取当前系统时间 now  ,

tomrrow=now + timedelta(days=1)  即得到明天的这个时间

strftime(tomrrow,"%Y-%m-%d %H:%M:%S")

tomrrow.strftime("%Y-%m-%d %H:%M:%S")

将所得到的时间tomrrow 进行相应格式化 

你可能感兴趣的:(python,python)