hello guys,
i have a problem on how to determine the 2 Night Differentials
first is the ND1 which is 22:01 to 00:00 and the ND2 which is 00:01 to 06:00
so if my log is 21:00 to 08:00, how to get the ND1 and ND2
any idea? thanks
hello guys,
i have a problem on how to determine the 2 Night Differentials
first is the ND1 which is 22:01 to 00:00 and the ND2 which is 00:01 to 06:00
so if my log is 21:00 to 08:00, how to get the ND1 and ND2
any idea? thanks
Make comparisons. This should get your on your way:
$yourstarttime = 2100;
$yourendtime = 3200;
$nd1start = 2201;
$nd1end = 2400;
$nd2start = 2401;
$nd2end = 3000;
$nd1time = 0;
$nd2time = 0;
if ($yourstarttime < $nd1start && $yourendtime > $nd1end) { $nd1time = $nd1end - $nd1start; }
if ($yourstarttime < $nd2start && $yourendtime > $nd2end) { $nd2time = $nd2end - $nd2start; }