title: Strip seconds from mySQL time and do am/pm
body: <h1>EDIT: This is NOT the way to do it. See answer below.</h1>
  
  <p>Not sure if I am allowed to post solutions but wasted 10 mins looking for this and hacked it in the end ... in about 10 mins.</p>
  
  <p>If you store 10:20 in mySQL it comes back as 10:20:00. If you want 10:20 then:</p>
  
  <pre><code>    $time= explode (':', $time);
      $ampm="am";
      if ($time[0]&gt;12) {$time[0]=$time[0]-12; $ampm="pm";};
      echo "$time[0]:$time[1]  $ampm,";
  </code></pre>
  
  <p>where <code>$time</code> is the time in from mySQL.</p>