title: MySQL insert to DATETIME: is it safe to use ISO::8601 format?
body: <p>In our project we use Zend Framework Model generator, which produces something like this to set the properties that are stored in DB (MySQL) as DATETIME fields:</p>
  
  <pre><code>public function setObjectDatetime($data) {
    if (! $data instanceof Zend_Date) { ... some conversion code ... }
    $this-&gt;objectDatetime = $data-&gt;toString(Zend_Date::ISO_8601);
  }
  </code></pre>
  
  <p>So the ISO::8601 formatted string ('2012-06-15T18:33:00+03:00' for example) is what actually is stored as a property. </p>
  
  <p>The problem arises when we try to <code>save</code> this model, and pass this string to MySQL (version 5.5.16): it raise the warning, but still inserts/updates the corresponding row with a correct result. It's easy to check that the issue is caused by MySQL, and not some drivers' behaviour: just issue such query as...</p>
  
  <pre><code>UPDATE table_name SET datetime_field = '2012-06-15T18:33:00+03:00' WHERE id = 1;
  </code></pre>
  
  <p>... and the result will be <code>1 row affected, 1 warning</code>, with </p>
  
  <p><code>1264 | Out of range value for column 'dt' at row 1</code> </p>
  
  <p>warning (shown by <code>SHOW WARNINGS</code>).</p>
  
  <p>To my amuzement, phpMyAdmin doesn't show any warnings at all; and all the server-side code processed this query as a solid one. ) </p>
  
  <p>So the question is: should we really reformat what we store in our Model into another string format ('YY-MM-dd HH:mm:ss', for example?) Or is it just some weird behavior of MySQL that will be fixed sooner or later?</p>