bigint to timestamp

Ulrich Eckhardt eckhardt at satorlaser.com
Wed Jan 28 08:31:00 EST 2009


Shah Sultan Alam wrote:
> 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

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list