import datetime #d1当前时间,d2未来时间 d1 = datetime.datetime(2021,1,21,19,46,0) d2 = datetime.datetime(2021,2,5,18,0,0) interval = d2 - d1 print(interval)
python3 日期时间差计算
原文:https://www.cnblogs.com/51testing/p/14310292.html