Newbie: datetime conversion question

Carsten Haese carsten at uniqsys.com
Tue Oct 17 09:02:04 EDT 2006


On Tue, 2006-10-17 at 08:43, kevin evans wrote:
> Hi,
> I'm trying to convert some code from Ruby to Python, specifically..
> 
> timestamp = "%08x" % Time.now.to_i
> 
> Make a hex version of the current timestamp. Any ideas how best to do
> this in python gratefully received..

import time
timestamp = "%08x" % int(time.time())

-Carsten





More information about the Python-list mailing list