python将int数据(秒)转化成【时:分:秒】

seconds = 15743

m, s = divmod(seconds, 60)

h, m = divmod(m, 60)

print("{0}:{1:02d}:{2:02d}".format(h, m, s))
4:22:23

 

posted @ 2020-03-05 21:18  douzujun  阅读(1599)  评论(0编辑  收藏  举报