Link to home
Start Free TrialLog in
Avatar of bhaskar20001
bhaskar20001Flag for India

asked on

How to convert bigint(20) into timestamp format using python

I have file with contents retrieved from mysql DB.
which has a time field with type defined bigint(20)
I want to parse that field into timestamp format(YYYY-MM-DD HH:MM:SS GMT) using python code.
The value I found for that field is 212099016004150509
Give me sample code that does the conversion.

Avatar of jdevera
Flag of Ireland image

The value you provided does not make sense to me as a date and time, nor as a unix timestamp. Can you please explain to what date and time does this value correspond?
Avatar of bhaskar20001


I also felt like that at first look as it is of length 18 digits long. But after browsing the net I found that there is possibility that the timestamp has been storing in this format in some DBs.

212099645407486318 is mostly nearby to the time 2009-Jan-25 12:16:00 GMT

I'm not sure about exact equivalent of time for the value given.
Avatar of bhaskar20001
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial