2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > 将指定的时间戳转换为日期格式

将指定的时间戳转换为日期格式

时间:2020-01-18 10:23:27

相关推荐

将指定的时间戳转换为日期格式

转载自:/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)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。