title: PHP: convert date to datetime and insert it into mysql database?
body: <p>I have an input field in my html page that gets <strong>Date</strong> from jQuery datepicker.</p>
  
  <p>The format looks like this:</p>
  
  <pre><code>18/02/2017
  </code></pre>
  
  <p>I have a MYSQL field which is <code>DATETIME</code></p>
  
  <p>I need to insert the Date above into this MYSQL field.</p>
  
  <p>So i tried this code:</p>
  
  <pre><code>$mysqlDate = date('Y-m-d H:i:s', strtotime($_POST['php_date']));
  </code></pre>
  
  <p>but the result of <code>$mysqlDate</code> is this:</p>
  
  <pre><code>1970-01-01 01:00:00
  </code></pre>
  
  <p>Could someone please advise on this issue?</p>
  
  <p>Thanks in advance.</p>