I have a string representing a unix timestamp (ie "1284101485") in Python, and I'd like to convert it to a readable date.
(我有一个表示Python中的unix时间戳(即“ 1284101485”)的字符串,我想将其转换为可读的日期。)
When I use time.strftime
, I get a TypeError
: (当我使用time.strftime
,出现TypeError
:)
>>>import time
>>>print time.strftime("%B %d %Y", "1284101485")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: argument must be 9-item sequence, not str
ask by VeryNewToPython translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…