python 13位时间戳转转为日期格式提示错误~!
本文介绍了python 13位时间戳转转为日期格式提示错误~!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
python 2.7
def timeStamp(timeNum):
timeStamp = float(timeNum)
timeArray = time.localtime(timeStamp)
otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
print otherStyleTime
调用函数timeStamp(1457410893000)
的时候
提示错误:ValueError: (22, 'Invalid argument')
求教,谢谢~!
解决方案
timeNum/1000
这篇关于python 13位时间戳转转为日期格式提示错误~!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文