I've been searching here and the php manual for the entire day trying to figure this out.
What I have is a time in this format, 6:32:47 PM and I want to compare it with the server time. If it is more than 20 minutes behind then I want to display a message.
What I came up with was to break that time into pieces 6 32 47 PM and try to convert it into unix style using mktime. I didn't get any further untill I ran into a problem I can't figure out. For some reason in the my code $mbmtime_hour want's to convert to 12 where marked even though it should be the right hour (it's not noon or midnight). if someone could please show me how to fix this or maybe make the code shorter it would definatly be apreciated.
<?
$data3 = 6:42:47 PM
$input = "$data3";
list($tmp_1a, $tmp_2a, $tmp_3a) = explode(':', $input);
list($time3a) = explode(':', $tmp_1a);
list($time3b) = explode(':', $tmp_2a);
list($time3c) = explode(':', $tmp_3a);
$input = "$time3c";
list($tmp_1b, $tmp_2b) = explode(' ', $input);
list($time3d) = explode(' ', $tmp_1b);
list($time3e) = explode(' ', $tmp_2b);
$mbmtime_hour = $time3a;
$mbmtime_minute = $time3b;
$mbmtime_seconds = $time3d;
$mbmtime_AMPM = $time3e;
$mbmtime_minute2 = ($time3b + 20);
echo date("M d Y, g:i:s",mktime('$mbmtime_hour,$mbmtime_minute,$mbmtime_seconds'))."<br>"; //problem line
$mbmtime_mk = mktime($mbmtime_hour,$mbmtime_minute,$mbmtime_seconds);
echo $mbmtime_mk ;
?>