Skip to content

Instantly share code, notes, and snippets.

@samsoir
Created March 10, 2009 14:37
Show Gist options
  • Select an option

  • Save samsoir/76906 to your computer and use it in GitHub Desktop.

Select an option

Save samsoir/76906 to your computer and use it in GitHub Desktop.
<?php
list($hours, $mins) = explode(':', $_POST['time']);
if ($_POST['ampm'] == 'am' AND $hours == 12)
$hours = 0;
elseif ($_POST['ampm'] == 'pm' AND $hours != 12)
$hours += 12;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment