Date Calculations

ok i know the code is long and repeditive but i am tired and this is the only way so far i have been able to get it to work

now i got this far, where is an employees review date is coming up it will or at least i think it will give me the proper date based on thier start date

the only thing i can’t figure out now is, after the first 2 years the reviews go yearly and i don’t really like this code and i don’t want to keep repeating it over and over again adding on months

$emp_start = 1207197780 ;

if(time() - $emp_start <= strtotime("+6 months") - time()) {
	echo "Next Date: ".date('F jS, Y', $emp_start + (strtotime("+6 months") - time())). "<br />" ;
}
elseif(time() - $emp_start <= strtotime("+12 months") - time()) {
	echo "Next Date: ".date('F jS, Y', $emp_start + (strtotime("+12 months") - time())). "<br />" ;
}
elseif(time() - $emp_start <= strtotime("+18 months") - time()) {
	echo "Next Date: ".date('F jS, Y', $emp_start + (strtotime("+18 months") - time())). "<br />" ;
	}
elseif(time() - $emp_start <= strtotime("+24 months") - time()) {
	echo "Next Date: ".date('F jS, Y', $emp_start + (strtotime("+24 months") - time())). "<br />" ;
}

so i am inquiring to see if anyone has dealt with this before and can point me in the right direction

basically our reviews are:
3 months
6 months
1 year
1 1/2 year
2 year
3 year
etc. yearly after that

if anyone has and ideas you help would be greatly apreciated

Thanks in Advance

Is there a roof value to this annual thing, or should it go on till 2265 or somethin?

no there is no roof value, some people have been in the company for as many as 25 years

i am looking for somthing that will loop or something till the value is true

i am just not sure how to do it

but if it is easier to have a roof value then i would say about 40 years from the employee startdate

Sponsor our Newsletter | Privacy Policy | Terms of Service