|
Posted by Gil on 06/21/07 17:42
I'm trying to mimic the functionality of netdaysworked in excel. The
code below works, except when the date starts during daylight savings
time. what is the number of seconds in a day for a daylight savings
day?
thanks,
gil
for ($dayval = $startdate; $dayval <=$enddate; $dayval+=$oneday){
if (date(I,$dayval)==0){
echo("daylight savings time<br>");
}
if(date(w,$dayval)==0){
$daysworked = $daysworked+0;
}
elseif(date(w,$dayval)==6){
$daysworked = $daysworked+0;
}
else{
$daysworked++;
}
echo("first day: ".$dayval." number of days ".($dayval/86400)."
lastday : ".$lastday."day of week :".date(w,$dayval)."date: ".date("m-
d-Y",$dayval)." days worked: ".$daysworked."<br><br>");
}
Navigation:
[Reply to this message]
|