python3 为什么我的比较会改变格式?

python3 why does my comparison change the formatting?

我有 1 次是这样格式化的

start_time  01:13:05

我有第二次看起来很像

Current time  01:13:10

当我计算差异时,它产生了正确的答案,但去掉了一个零

代码:

new_start_time = datetime.strptime(start_time, '%H:%M:%S')
new_current_time = datetime.strptime(str(current_time), '%H:%M:%S')
elapsed_time = new_current_time - new_start_time

产生:

elapsed time  0:00:10

10 是正确的,但是 0 怎么了?我该如何破解它?我需要它。

添加:

elapsed_split = str(elapsed_time).split(":")
elapsed_time = int(elapsed_split[0]).zfill(2) + elapsed_split[1:]