You are here: Dates, daylight savings and netdaysworked « PHP Programming Language « IT news, forums, messages
Dates, daylight savings and netdaysworked

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация