I am trying to convert a timestamp (that I don't know how it is convert) to datetime.
I have this input: 1217099350.0
If I write this on Libreoffice calc (1217099350.0/86400) + 29226 and format the cell to date time. I have a correct output:
31/07/2018 19:09:10
But if I make this on python:
tt = 1217099350.0
tt2 = (tt / 86400.) + 29226.
tt3 = datetime.fromtimestamp(tt2).strftime("%Y-%M-%d %H:%m:%S"
print(tt3)
I have the next output:
1970-01-01 09:01:52
What is the problem on my code?
Thanks! Regards!
(1217099350 / 86400) + 29226is about 43312, which is approximately the number of seconds in a twelve hour span, so it makes sense that the resulting datetime is about twelve hours after the Unix epoch. If anything, it's Libreoffice that's wrong.