title: Format time string in Python 3.3
body: <p>I am trying to get current local time as a string in the format: year-month-day hour:mins:seconds. Which I will use for logging. By my reading of the documentation I can do this by:</p>
  
  <pre><code>import time
  '{0:%Y-%m-%d %H:%M:%S}'.format(time.localtime())
  </code></pre>
  
  <p>However I get the error:</p>
  
  <pre>
  Traceback (most recent call last):
  File "", line 1, in 
  ValueError: Invalid format specifier
  </pre>
  
  <p>What am I doing wrong? Is there a better way?</p>