seconds=25643
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
print ("%02d:%02d:%02d" % (h, m, s))
print(f"Etc time: {int(h)}:{int(m)}:{int(s)}")
输出:
Etc time: 6:48:32
参考文章:
- 【Python基础】python如何把秒换成时分秒
欢迎分享,转载请注明来源:内存溢出
seconds=25643
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
print ("%02d:%02d:%02d" % (h, m, s))
print(f"Etc time: {int(h)}:{int(m)}:{int(s)}")
输出:
Etc time: 6:48:32
参考文章:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)