Unix laika zīmoga virknes konvertēšana uz lasāmu datumu
Man ir virkne, kas atveido unix laika zīmogu (t.i., "1284101485") Python, un es gribētu to pārvērst uz lasāmu datumu. Kad es izmantoju time.strftime
, man parādās 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
751
3
Izmantot
datetime
moduli:Pārņemts no http://seehuhn.de/pages/pdate