title: TypeError: 'datetime.datetime' object is not iterable
body: <p>I'm writing a python script that hits an API and then writes various data to a MySQL database. </p>
  
  <p>One of the fields I'm trying to write is a date object, but I keep running into a "TypeError: 'datetime.datetime' object is not iterable" error and can't seem to get past it. I'm convinced it's something really simple, but I can't figure out what. </p>
  
  <p>First, I call the API to get a json object with several dates and metrics in them. Then I loop through the dates and am trying to write them to the DB. </p>
  
  <pre><code>for day in results:
  
     mydate = datetime.datetime.strptime(day['date'], '%Y-%m-%d')
  
     print mydate
  
     date_query = "INSERT INTO sendgrid_stats (date) VALUES (%s)"
  
     cursor.execute(date_query, mydate)
     connection.commit()
  </code></pre>
  
  <p>If you print the date that's attempted to be inserted, it looks like "2015-07-26 00:00:00" (without the quotes).</p>
  
  <p>Does anyone know what I'm doing wrong? My face hurts from banging my head into the keyboard.</p>