title: HTML5 date input, saving to MySQL database
body: <p>I'm having a bit of trouble, and can't seem to find any solid answers. BUt hoping someone could help.</p>
  
  <p>I have an HTML5 input form that gets a chosen date</p>
  
  <pre><code>&lt;input type="date" name="launch_date" /&gt;
  </code></pre>
  
  <p>This brings up the datepicker, and enters the date in dd/mm/yy</p>
  
  <p>I'm trying to save this to a SQL database, that using the DATE type in the table. So first I make variables of all the form inputs</p>
  
  <pre><code>$launch_date = $_POST['launch_date'];
  </code></pre>
  
  <p>And then I've tried to convert the string to a proper timestamp so it can be accepted in the database.</p>
  
  <p>Then all the variables are added into the correct columns as part of the SQL INSERT/UPDATE query.</p>
  
  <pre><code>$launch_date = strtotime($launch_date);
  </code></pre>
  
  <p>Whenever I look into the database though, it's just always showing 0000-00-00, like it's expecting a YYYY-MM-DD format.</p>
  
  <p>How can I get it so that the date entered on the front end is DD-MM-YYYY, but stored in the database correctly as YYYY-MM-DD?</p>
  
  <p>UPDATE</p>
  
  <p>Okay, so I think I was trying to make it too complicated. By using the HTML5 date input, and saving that input directly to the database into a DATA type column, saves it as YYY-MM-DD. Seems to work fine.</p>
  
  <p>When I echo these values, it will output for example 2014-09-24. How can I make it show 24-09-2014?</p>
  
  <pre><code>&lt;?php echo $row['start_date'];?&gt;
  </code></pre>