title: convert unix timestamp php
body: <p>I have a database that stores the time for me. I insert it from PHP using </p>
  
  <pre><code>date( 'Y-m-d H:i:s');
  </code></pre>
  
  <p>I then use this function to convert it to a unix timestamp in PHP</p>
  
  <pre><code>function convert_datetime($str) 
  {
  list($date, $time) = explode(' ', $str);
  list($year, $month, $day) = explode('-', $date);
  list($hour, $minute, $second) = explode(':', $time);
  
  $timestamp = mktime($hour, $minute, $second, $month, $day, $year);
  
  return $timestamp;
  }
  </code></pre>
  
  <p>What I now need to do is convert this timestamp to the date and time in this format:
  yyyymmddhhmmss (without any hyphens, dashes, colons, etc).</p>
  
  <p>Has anyone any ideas?</p>