Tuesday, March 6, 2012

add number of days in current date and time using php

0
 if you want to add the days in current date and time then this function will help you to do that...

copy this code and run this to see the desire result (:

function adddays($toDay){
$incement=30;//number of days increment
$Day = strtotime(date("Y-m-d H:i:s", strtotime($toDay)) . " +$incement days");
$days=date("Y-m-d H:i:s",$Day);
$days=date("Y-m-d H:i:s",$Day);
return     $days;


}
echo  adddays('2012-03-05 12:07:34');
?>
/*********************************************
Output : 2012-04-04 12:07:34
/*********************************************

No comments :

Post a Comment