rgb192
asked on
current date+4 days
current date+4 days
ASKER
how do I call this function
$newdate = add_date(curdate(),4)
echo format($newdate,'m/d/Y');
echo format($newdate,'m/d/Y');
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
You can also modify to add to hours, miuntes and even seconds.
<?php
function add_date($givendate,$day=0
$cd = strtotime($givendate);
$newdate = date('Y-m-d h:i:s', mktime(date('h',$cd),
date('i',$cd), date('s',$cd), date('m',$cd)+$mth,
date('d',$cd)+$day, date('Y',$cd)+$yr));
return $newdate;
}
?>