Hello All,
I have a variable formatted like so:
$start_time = $_POST['start_hour'] . ':' . $_POST['start_minute'] . ':00';
$start_ampm = $_POST['start_ampm']; //specifies if start time is in AM or PM
$end_time = $_POST['start_hour'] . ':' . $_POST['start_minute'] . ':00';
$end_ampm= $_POST['end_ampm']; //specifies if end time is in AM or PM
How would I prepare that into a 24 hour format so I can insert into a MySQL database field? I know I can do it using switch() manually but is there a way to automate it?
Also, does anyone know how to calculate the difference in two time variables (as seen above)?