秒数的处理 1970

import time,datetime
timeArray = time.localtime(1552867907)#1970秒数
print(timeArray,"timeArray")
otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
datetime1=datetime.datetime.strptime(otherStyleTime, "%Y-%m-%d %H:%M:%S")
print(datetime1,"datetime1")

------输出 》》》2019-03-18 08:11:47

原文地址:https://www.cnblogs.com/guanong/p/10564989.html