I have a duration like this: 211:30:24. I have to compare whether it’s greater than other duration like 01:00:00. I am using strtotime function to change duration into int and then comparing it.
But the problem is strtotime(211:30:24) is returning false. Up to 24:00:00, it’s working fine.
I am using below code:
$duration = strtotime('211:30:24');
if($duration >= strtotime ( '01:00:00' )){
return true;
}else{
return false;
}
$duration is false.
I am using php5.1. Anybody have idea why it’s happening.
Please go through
http://www.php.net/manual/en/datetime.formats.time.php
the time you specified is not valid, valid time format is mentioned in the document