I don't have experience in working with timestamps. I started analyzing new data frames containing a column of timestamp such as: time= 1599091199986769056
. I would like to transform a column of timestamps to date and time. so I tried the following for one row:
ts = int("1599091199986769056")
print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
But I get the following error:
----> 1 print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
OSError: [Errno 22] Invalid argument
Can anyone tell me what I'm doing wrong and how can I turn a column from timestamp to date time ?