import datetime
end_time = 1525104000000
d = datetime.datetime.fromtimestamp(end_time / 1000, None) # 时间戳转换成字符串日期时间
str1 = d.strftime("%Y-%m-%d %H:%M:%S.%f")
print(d) # 2018-05-01 00:00:00
print(str1) # 2018-05-01 00:00:00.000000
python fromtimestamp 时间戳转换成字符串日期时间
最新推荐文章于 2025-02-06 17:31:16 发布