一、两种时间戳转换为时间格式:13位和10位,将时间戳转成时间格式
import time
#13位时间戳转时间
tre_timeArray = time.localtime(1646012206685/1000)
tre_otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", tre_timeArray)
print('tre_otherStyleTime',tre_otherStyleTime)
#10位时间戳转时间
ten_timeArray = time.localtime(1632651709)
ten_otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", ten_timeArray)
print('ten_otherStyleTime',ten_otherStyleTime)
二、生成时间戳的写法
心有猛虎,细嗅蔷薇