I have used a ruby script to convert iso time stamp to epoch, the files that I am parsing has following time stamp structure:
2009-03-08T00:27:31.807
Since I want to keep milliseconds I used following ruby code to convert it to epoch time:
irb(main):010:0> DateTime.parse('2009-03-08T00:27:31.807').strftime("%Q")
=> "1236472051807"
But In python I tried following:
import time
time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(1236472051807))
But I don't get the original time date time back,
>>> time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(1236472051807))
'41152-03-29 02:50:07'
>>>
I wonder is it related to how I am formatting?