I want to get a Date from a UNIX Timestamp in Python with the following code:
datetime.fromtimestamp(timestamp)
with the timestamp being 1605532620337.2188, but I am getting this error:
OSError: [Errno 22] Invalid argument
I want to get a Date from a UNIX Timestamp in Python with the following code:
datetime.fromtimestamp(timestamp)
with the timestamp being 1605532620337.2188, but I am getting this error:
OSError: [Errno 22] Invalid argument
Try this:
from datetime import datetime
print(datetime.fromtimestamp(1605532620337.2188 // 1000))
Output:
2020-11-16 14:17:00