title: uk date format in mysql
body: <p>i'm having trouble getting the date to be imported into mysql from my form.</p>
  
  <p>my form is validated so that the input will always be dd/mm/yyyy</p>
  
  <p>i'm currently using </p>
  
  <pre><code>$date = date('Y/m/d', strtotime($_POST['night_attending']));
  </code></pre>
  
  <p>this takes the value from the form and assigns it the year/month/day</p>
  
  <p>the problem is that its reading my form as mm/dd/yyyy</p>
  
  <p>i can swap the code to 'Y/d/m' which will put it into my database the right way round but it will stop working if the day is past the 12th as it still believes that it is the month</p>
  
  <p>i have tried using </p>
  
  <pre><code>date_default_timezone_set('Europe/Dublin');
  </code></pre>
  
  <p>and</p>
  
  <pre><code>date_default_timezone_set('Europe/London');
  </code></pre>
  
  <p>but it makes no difference</p>
  
  <p>i'm contemplating just using the mm/dd/yyyy format on my form, but this isn't great as it's a uk site.</p>
  
  <p>has anybody encountered this problem? i'm sure it must be comman and there must be a simple answer that i'm missing.</p>
  
  <p>thanks</p>
  
  <p>alsweet</p>