Convert the base date into a UNIX timestamp using mktime();
You get the number of seconds since 1,1,1970.
Add or subtract to this number 86400 number of days you want to add or subract, to it, for example 1586400.
3 Convert back this new number to a date using the date() function.
This function for example wraps all the operations :
function addDays($year,$month,$day,$daystoadd) {
$secondsInDay = 86400;
$timestamp = mktime(0,0,0,$month,$day,$year);
$timestamp += $daystoadd * $secondsInDay;
return date("Y-m-d",$timestamp);
}
if you need to subtract days you can give it a negative number as 4th parameter.
One should add date checking to this but you can start from there...