timedelta = datetime1-datetime2
理解:一个时间等于两个时刻做差
import datetime
if __name__ == '__main__':
datetime1 = datetime.datetime.strptime('12:10:00', '%H:%M:%S')
datetime2 = datetime.datetime.strptime('12:00:00', '%H:%M:%S')
timedelta = datetime1-datetime2
print(timedelta)
能用就好;忙活了2小时知道的结论
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)