转载自:/1314520xh/p/16328808.html
注意观察时间戳是多少位
两种时间戳转换为时间格式: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)