title: Insert query for mysql databse for datetime data type in cherrypy
body: <p>Here is my <strong>insert query</strong> which is working correctly,</p>
  
  <pre><code>db = MySQLdb.connect(host="localhost",user="root",passwd="", db="databseFile")
  cur = db.cursor()
      print "source_id is: ",srcId[0]
      cur.execute('INSERT into config(col_1,col_2) values("%s","%s")'%(detail_1,detail_2))
      db.commit()
      cur.close()
  </code></pre>
  
  <p>And here is how to get datetime in python:</p>
  
  <pre><code>from datetime import datetime
  currentTime=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  </code></pre>
  
  <p>I want to insert currentTime into my config Table.<strong>What is the data type for datetime?</strong> I searched on net, but i didn't find any solution. My question is, <strong>How to write insert query to insert datetime in database(I am using cherrypy and mysql).</strong> </p>
  
  <p>I want something like this:</p>
  
  <pre><code>cur.execute('INSERT into config(col_1,col_2,col_3) values("%s","%s","WhatToWriteHere???")'%(detail_1,detail_2, currentTime))
  </code></pre>