Menu
Hello,
I have two datetime stamps I need to determine the business hours affected during these two datetime stamps.
I’m working along the lines of the following:
[code=php]
function calcBusiness($stime,$ftime){
$stime = explode(‘ ‘,$stime);
$ftime = explode(‘ ‘,$ftime);
if($stime[0] > $ftime[0])
{
if($stime[1] <= ’04:00:00′){
if($ftime[1] >= ’20:00:00′){
$stimeMIN = strtotime($stime[1]);
$ftimeMIN = strtotime($ftime[1]);
$diffMIN = round(abs($ftimeMIN – $stimeMIN) / 60,2);
}
}
}else{
echo “00:00:00”;
}
if($stime[0] == $ftime[0]
return $totalBusinessHours;
}
I’ve hit a bit of a cross road here.
HELP?!?!