Convert from UNIX timestamp (with milliseconds) to HH:MM:SS in Python

Viewed 11124

I need to convert UNIX timestamp in miliseconds to HH:MM:SS. If I try to do this:

import datetime
var = 1458365220000
temp = datetime.datetime.fromtimestamp(var).strftime('%H:%M:%S')
print (temp)

It's doesn't works, and the error I am getting is is:

OSError: [Errno 22] Invalid argument

1 Answers
Related