title: php dateTime::createFromFormat in 5.2?
body: <p>I have been developing on php 5.3.</p>
  
  <p>However our production server is 5.2.6.</p>
  
  <p>I have been using</p>
  
  <pre><code>$schedule = '31/03/2011 01:22 pm'; // example input
  if (empty($schedule))
      $schedule = date('Y-m-d H:i:s');
  else {
      $schedule = dateTime::createFromFormat('d/m/Y h:i a', $schedule);
      $schedule = $schedule-&gt;format('Y-m-d H:i:s');
  }
  echo $schedule;
  </code></pre>
  
  <p>However that function is not available in 5.2</p>
  
  <p>What is the easiest way to get around this (no chance of a php upgrade).</p>