I am trying to do a date calculation and for the most part i have it working
$emp_start = 1161410400 ;
if($emp_start <= strtotime("-2 years")) {
echo "Next Date: ". date('F jS, Y', $emp_start + (strtotime("24 months") - time())) . "<br />" ;
}
elseif ($emp_start <= strtotime("-18 months")) {
echo "Next Date: ". date('F jS, Y', $emp_start + (strtotime("18 months") - time())) . "<br />" ;
}
elseif ($emp_start <= strtotime("-12 months")) {
echo "Next Date: ". date('F jS, Y', $emp_start + (strtotime("12 months") - time())) . "<br />" ;
}
elseif ($emp_start <= strtotime("-6 months")) {
echo "Next Date: ". date('F jS, Y', $emp_start + (strtotime("6 months") - time())) . "<br />" ;
}
elseif ($emp_start <= strtotime("-3 months")) {
echo "Next Date: ". date('F jS, Y', $emp_start + (strtotime("3 months") - time())) . "<br />" ;
}
echo date('F jS, Y', $emp_start) . "<br />" ;
now I have the employee start date as Oct 21, 2006
and as of todays date their next review date should be oct 21, 2008
now I know this year is a leap year
but what i am wondering is if there is a way to calculate in a time span how may leapyears there has been and the add that many days to the total
as this is not the entire calculation, reviews are done yearly after the first to years so i will be adding a loop to calculate the rest.
thanks in advance for you help