Strtotime
It converts the date into unix time stamp format.
echo $dateTime=strtotime(“13-02-2016”);
?>
OUTPUT
To add no. of days in current date
$currDate = date(‘Y-m-d’) ; // 2016-04-02
$dateTime=strtotime(“$currDate + 5 days”);
echo date(“Y-m-d”, $dateTime);
?>
OUTPUT
You can also add weeks in the current Date like the following
$currDate = date(‘Y-m-d’) ; // 2016-04-02
$dateTime=strtotime(“$currDate + 2 weeks”);
echo date(“Y-m-d”, $dateTime);
?>
OUTPUT
Leave a comment