Re: Newbie: datetime conversion question

2006-10-17 Thread kevin evans
Great stuff - many thanks hg wrote: > Carsten Haese wrote: > > On Tue, 2006-10-17 at 08:49, hg wrote: > >> import time > >> "%08X"% (int)(time.mktime(time.localtime())) > > > > Have you not had your coffee yet or are you trying to win an obfuscated > > python programming competition? ;) > > > >

Re: Newbie: datetime conversion question

2006-10-17 Thread hg
Carsten Haese wrote: > On Tue, 2006-10-17 at 08:49, hg wrote: >> import time >> "%08X"% (int)(time.mktime(time.localtime())) > > Have you not had your coffee yet or are you trying to win an obfuscated > python programming competition? ;) > > -Carsten > > Just one cup hg -- http://mail.python.

Re: Newbie: datetime conversion question

2006-10-17 Thread Carsten Haese
On Tue, 2006-10-17 at 08:49, hg wrote: > import time > "%08X"% (int)(time.mktime(time.localtime())) Have you not had your coffee yet or are you trying to win an obfuscated python programming competition? ;) -Carsten -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: datetime conversion question

2006-10-17 Thread skip
kevin> I'm trying to convert some code from Ruby to Python, kevin> specifically.. kevin> timestamp = "%08x" % Time.now.to_i kevin> Make a hex version of the current timestamp. Any ideas how best kevin> to do this in python gratefully received.. Try import time times

Re: Newbie: datetime conversion question

2006-10-17 Thread hg
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.. > how about import time "%08X"% (int)(time.mkt

Re: Newbie: datetime conversion question

2006-10-17 Thread Carsten Haese
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 timestam

Re: Newbie: datetime conversion question

2006-10-17 Thread Fredrik Lundh
"kevin evans" wrote: > 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.. that's perfectly valid Python code, provided Time is a