gt; To: python-list@python.org
>> Subject: Re: formated local time
>> If you want the formatted string, you can use strftime:
>>
>> >>> time.strftime("%Y-%m-%d %H:%M:%S")
>> '2007-11-15 07:51:12'
>
> datetime also has the strftime method
You could use:
import time
time.strftime( "%Y-%m-%d %H:%M:%S" )
or
time.strftime( "%Y-%m-%d %H:%M:%S", time.localtime() )
Output:
'2007-11-15 11:02:34'
Both strftime calls are equivalent, in this case.
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> ] On
On Nov 15, 7:19 am, Nikola Skoric <[EMAIL PROTECTED]> wrote:
> I have been trying to find appropriate way to do get local time in
> "-mm-dd hh:mm:ss" format, but the best I got is this:
> datetime.datetime.fromtimestamp(time.mktime(time.localtime()))
> It seems to me I'm missing a much simpler
9:56 AM
> To: python-list@python.org
> Subject: Re: formated local time
>
> On Nov 15, 7:19 am, Nikola Skoric <[EMAIL PROTECTED]> wrote:
> > I have been trying to find appropriate way to do get local time in
> > "-mm-dd hh:mm:ss" format, but the be