title: Insert h:mm pm/am time format into database using MYSQL
body: <p>I'm trying to insert a time written in h:mm am/pm format into a database that is stored as standard DATETIME format ( hh:mm:ss ) but I can't figure out how to convert the posted time into standard format so the database will accept it.</p>
  
  <p>This is what I've been trying so far:</p>
  
  <pre><code>$title = $_POST['inputTitle'];
  $date = $_POST['inputDate'];
  $time = date('h:i:s a', strtotime($_POST['inputTime']));
  $desc = $_POST['inputDesc'];
  
  
  //msql query to insert data
  $query = "INSERT INTO events(title, date, time, description) VALUES ('$title','$date','$time','$desc')";
  </code></pre>
  
  <p>but this doesn't work(time still won't submit) any ideas?</p>