View Single Post
Old 10-03-2005, 11:04 PM  
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
PHP Code:
    function workingDayDifference($_date1$_date2) {
            
$cal         = new holiday_class($_year);

            list(
$date1_year$date1_month$date1_day) = split('[/.-]'$_date1); 
            list(
$date2_year$date2_month$date2_day) = split('[/.-]'$_date2); 
            
            
$origjd     unix_to_jd(mktime(0,0,0,$date1_month$date1_day$date1_year));
            
$jd         unix_to_jd(mktime(0,0,0,$date2_month$date2_day$date2_year));
            
            
$difference $jd-$origjd//Calcuates Difference
            
$difference    floor($difference/60/60/24);
            
$daysOff    0;            
            for (
$i=0$i <= $$difference$i++) {  
                
//If day is a holiday, then increase the number if days.
                
while ((strlen($cal->GetHolidays($jd+$i)) > ) || ($cal->isWeekend($jd+$ihahahaha true)) {
                        
//echo "<u>Found day off</u><br>";
                        
$daysOff++;
                    }
        
            }
            return 
$difference-$daysOff;            
    } 
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote