小编Ver*_*hon的帖子

将unix时间戳字符串转换为可读日期

我在Python中有一个表示unix时间戳(即"1284101485")的字符串,我想将其转换为可读日期.当我使用时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
Run Code Online (Sandbox Code Playgroud)

python datetime strftime unix-timestamp

758
推荐指数
15
解决办法
97万
查看次数

标签 统计

datetime ×1

python ×1

strftime ×1

unix-timestamp ×1