Rahul Rahul - 8 months ago 54
PHP Question

Add 30 days to date

Hello all i am trying to add 30 days to my date. I am using below coding.

$next_due_date = date('05/06/2016', strtotime("+30 days"));
echo $next_due_date;

But it is returning to "05/06/2016" only!

Please help me!


You need to provide date format like d/m/Y instead of 05/06/2016


$old_date = '05-06-2016';
$next_due_date = date('d-m-Y', strtotime($old_date. ' +30 days'));
echo $next_due_date;