title: How to set default current datetime in Mysql field
body: <p>I am working on one project having frontend as <code>PHP</code> and backend <code>MySql</code> with XAMPP server.</p>
  
  <p>I have one field named "created" with datatype as <code>DATETIME</code> in <code>MySQl</code>.I required to pass defauld current datetime value to this field.</p>
  
  <p>I knew that there are some function in <code>PHP</code> to add current datetime to <code>MySql</code> database like </p>
  
  <pre><code>date_default_timezone_set("America/Chicago");
  
  $date = date('Y-m-d H:i:s');
  </code></pre>
  
  <p>In some case(possible by mistake),PHP code may not pass datetime in mysql and defaul it is taking "0000-00-00 00:00:00" by <code>MySql</code>.</p>
  
  <p>Can any one guide me to what word I need to add as default value for this created field.</p>
  
  <p>I have tried to add CURRENT_TIMESTAMP as default value.</p>
  
  <p>But It give me error :</p>
  
  <pre><code> #1067 - Invalid default value for 'created' 
  </code></pre>
  
  <p>Can anyone give me direction on this.</p>
  
  <p>Thanks.</p>