<?php $start= "2018-05-17 05:04:34"; $end = "2018-05-17 17:04:34"; //Note that it's intentionally reversed $diff = strtotime(substr($start,11))-strtotime(substr($end,11)); //If the calculation was reversed add one day in seconds if($diff <0) $diff += 86400; If($diff >3600){ Echo "more than one hour"; }Else{ Echo "less than one hour"; }
You have javascript disabled. You will not be able to edit any code.