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)