import time
timestamp = 1462451334
#转换成localtime
time_local = time.localtime(timestamp)
#转换成新的时间格式(2016-05-05 20:28:54)
dt = time.strftime("%Y-%m-%d %H:%M:%S",time_local)
print (dt)
import time
timestamp = 1462451334
#转换成localtime
time_local = time.localtime(timestamp)
#转换成新的时间格式(2016-05-05 20:28:54)
dt = time.strftime("%Y-%m-%d %H:%M:%S",time_local)
print (dt)
本文标题:python 时间戳转标准格式
本文链接:https://www.haomeiwen.com/subject/jezrpftx.html
网友评论