一、将秒转化为 时:分:秒
seconds = 24503
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
print("%d:%02d:%02d" % (h, m, s))
输出 6:48:23
二、将“时间戳”转化为 年-月-日 时:分:秒
import time
timeArray = time.localtime(1789982700) # 秒数
otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
print(otherStyleTime)
输出 :2026-09-21 17:25:00