def convertMillis(millis):
a_test = millis // 1000
if a_test <= 60:
print(f"0:0:{a_test}")
elif 3600 >= a_test >= 60:
minute_test = a_test // 60 % 60
second_test = a_test % 60
print(f"0:{minute_test}:{second_test}")
elif a_test > 3600:
minute_test = a_test // 60 % 60
second_test = a_test % 60
hour_test = a_test // 3600
print(f"{hour_test}:{minute_test}:{second_test}")
convertMillis(5500)
convertMillis(1000000)
convertMillis(10000000)
07-27
862
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)