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 undefined
Last Comment

8/22/2022 - Mon

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?

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.

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck