= $DST_begin) && ($date_ck + 3600 <= $DST_end)){ return (1); // return one if DST is in effect on this date } else{ return (0); // return zero if DST is not in effect on this date } } // // this function finds the requested (1st 2nd etc.)occurance of a day (0=Sunday - 6=Saturday) in the month (1-12) and year (xxxx) requested function OCR ($occur,$day,$month,$year){ $occur--; //Decrement so multiplication works later if ($occur < 0){$occur = 0;} //Limit to positive interger if ($occur > 4){$occur = 4;} //Limit to 5th occurance in month $dom = 1; $Ocr_date = mktime (2,0,0,$month,$dom,$year); //Start at 2:00am on 1st of the month while (date("w",$Ocr_date) != $day){ //Check to see if it is the day wanted $dom++; //Increment the day of the month $Ocr_date = mktime (2,0,0,$month,$dom,$year); //Update the date } $dom = $dom + ($occur*7); //Add 7 times the occurance to the first occurance to get our date if ($dom > date("t")){$dom = $dom - 7;} // If past the end of the month, subtract 7 days (finds last occurance in month) $Ocr_date = mktime (2,0,0,$month,$dom,$year); //Update the date return $Ocr_date; //return the date found } ?>