日期时间转换被错误地修改

I am having issues getting my code to return the correct response.

$Birthd = '06-27-1996';

$NewISSdate = date("m-d-Y", strtotime(date("m-d-Y", strtotime($Birthd)) . " +21 years"));

When I run this the response is: "12-31-1969"

I believe this is a default date of sorts, but what can I do to repair my code? If ran with a different $Birthd string such as "07-03-1996".

You need to change string date format and then add years to it like below:-

$Birthd = '06-27-1996';
$Birthd = str_replace("-","/",$Birthd);

echo $NewISSdate = date("Y-m-d", strtotime(date("Y-m-d", strtotime($Birthd)) . " + 21 years"));

Output:-https://eval.in/835509 OR https://eval.in/835555

Reference:- php different acceptable date formats

Change - to / and try...

$Birthd = '06/27/1996';

$NewISSdate = date("m/d/Y", strtotime(date("m/d/Y", strtotime($Birthd)) . " +21 years"));