【发布时间】:2021-10-09 23:34:27
【问题描述】:
我正在使用 时间模块 使用下面的代码将纪元转换为人类可读的日期。
import time
datetime = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime(1609740000000))
print(datetime)
>>> Thu, 17 Aug 52980 20:00:00 +0000
我在https://www.epochconverter.com查看时输出不正确
正确的输出应该是 Wed, 04 Aug 2021 21:49:24 +0000
【问题讨论】:
标签: python python-3.x datetime time epoch