I need to get year 30+ years in the future, which is why I am using below code.
$currentDate = date("Y-m-d");
$dateOneYearAdded = strtotime(date("Y-m-d", strtotime($currentDate)) . " +30 year");
$endYr = date('Y', $dateOneYearAdded);
But as I tested this code its working for 26 years only. I can add only 26 year into the current year. If I try to add more than 26 then it will revert to the year 1970.
Below code is working fine:
$currentDate = date("Y-m-d");
$dateOneYearAdded = strtotime(date("Y-m-d", strtotime($currentDate)) . " +26 year");
$endYr = date('Y', $dateOneYearAdded);
Is there something wrong with my code or is it an error in the PHP function?