bigint to timestamp

S

Shah Sultan Alam

Hi Group,
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.

Regds
Shah
 
U

Ulrich Eckhardt

Shah said:
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.

Try time.strftime.
The value I found for that field is 212099016004150509

That looks like a bit big for digestion by strftime, so I'd suggest you
first find out what the unit and offset of the value in your DB actually
is.

Uli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top