i am tring to convert this unix timestamp 1491613677888 to readable date. found here (stackoverflow) that python script:
import datetime
print(
datetime.datetime.fromtimestamp(
int("1284101485")
).strftime('%Y-%m-%d %H:%M:%S')
)
but when i put my timestamp there, i got that error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
now i see that the timestamp that i am using is 3 chars longer. i checked it on this link: http://www.unixtimestamp.com/index.php
and saw that its get the time out of it. how can i do it using python? (i am using python 3.4)
1491613677is 2017-04-08T01:07:57+00:00, which is probably what you wanted. With it, your code works perfectly.int("1284101485888")on Python 2 I get ValueError: year is out of range, on Python 3.6 I get 42661-07-22 17:11:28.