Python 1.5.2 -- assigning current time to a variable?

Scott Nadeau scott.nadeau at sanmina.com
Wed Oct 31 11:41:53 EST 2001


Thank you Oleg.  I should have figured that out on my own.

Scott

 -----Original Message-----
From: 	Oleg Broytmann [mailto:phd at phd.fep.ru]  On Behalf Of Oleg Broytmann
Sent:	Wednesday, October 31, 2001 11:28 AM
To:	scott.nadeau at sanmina.com
Cc:	python-list at cwi.nl
Subject:	Re: Python 1.5.2 -- assigning current time to a variable?

On Wed, Oct 31, 2001 at 04:24:50PM -0000, scott.nadeau at sanmina.com wrote:
> timestring = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
>
> Yields:
> TypeError: function requires at least one argument
>
> How do I pass the argument?

timestring = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))

Oleg.
--
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list