【发布时间】:2021-03-03 14:10:14
【问题描述】:
我写了这段代码:
chegada = input('Enter arrival time: "Hours: Minutes" ')
saida = input('Inform the time of departure: "Hours: Minutes" ')
fmt = '%H:%M'
tdelta = datetime.strptime(saida, fmt) - datetime.strptime(chegada, fmt)
if tdelta.days < 0:
tdelta = timedelta(days=0, seconds=tdelta.seconds,
microseconds=tdelta.microseconds)
现在我想知道如何在几秒钟内转换
【问题讨论】:
标签: python-3.x timedelta