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
> "yyyy-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 method, am I?


If you want the formatted string, you can use strftime:

>>> time.strftime("%Y-%m-%d %H:%M:%S")
'2007-11-15 07:51:12'

--
Hope this helps,
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to