600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > python 时间戳 转换为 日期格式

python 时间戳 转换为 日期格式

时间:2020-11-30 04:10:22

相关推荐

python 时间戳 转换为 日期格式

python 时间戳 转换为 日期格式

首先需要看你的 时间戳 是 int 格式不

然后看 时间戳是 10位的,还是13位的。

13位的是 毫秒为单位

10位的是秒为单位

python 中的时间戳是10位的

web中的有的时候时间戳是13位的

time_local = time.localtime(int(datt['reportTime'])/1000)reportTime = time.strftime("%Y-%m-%d %H:%M:%S", time_local)logger.info("reportTime:{}".format(reportTime))

时间戳举例

168498964155714624513341500000000

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