$somedate = \"1980-02-15\";
$otherdate = strtotime(\'+1 year\', strtotime($somedate));
echo date(\'Y-m-d\', $otherdate);
outputs
19
strtotime() uses a unix timestamp, so it overflows if it attempts to calculate years beyond 2038 and reverts back to 1970.
To get around this, use the DateTime object. http://php.net/manual/en/book.datetime.php
To add a period of time to a DateTime object, use DateTime::add, which takes a DateInterval as a parameter. http://php.net/manual/en/datetime.add.php http://www.php.net/manual/en/class.dateinterval.php
$date = new DateTime("1980-02-15");
if (method_exists("DateTime", "add")) {
$date->add(new DateInterval("Y75"));
} else {
$date->modify("+75 years");
}
echo $date->format("Y-m-d");