title: How to save timestamp in mysql using php?
body: <p>I have startTime column as timestamp datatype in DB,I pass the timestamp(20160105123067) to save record, it automatically saves value '0000-00-00 00:00:00' into that database table. Actually I have write API in yii2. I trouble with this please help me.. </p>
  
  <p>Thanks in advance</p>
  
  <pre><code>$appointmentModel-&gt;startTime = $_POST['startTime'];
  $appointmentModel-&gt;startTime = Date("Y-m-d h:i:s", $appointmentModel-&gt;startTime);
  </code></pre>