title: Invalid datetime format: 1292 Incorrect datetime value
body: <p>I am getting below error when I am trying to update a table with a field(datetime)</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[2007]: Invalid datetime format: 1292 Incorrect datetime value: '02-27-2017 16:37' for column lastupated </p>
  </blockquote>
  
  <p>My PHP code uses PDO </p>
  
  <pre><code>$lastupdated = date('m-d-Y H:i:s');
  $run = $conn-&gt;prepare($sql);
  $run-&gt;bindParam(':lastupdated', $lastupdated, PDO::PARAM_STR); 
  </code></pre>
  
  <p>the SQL 
  the lastupdated, datatype is <code>datetime</code></p>
  
  <p>Existing data</p>
  
  <p><a href="https://i.stack.imgur.com/SykVZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SykVZ.png" alt="enter image description here"></a></p>