Answer the question
In order to leave comments, you need to log in
How to set a date and add 30 days to it?
Tell me how to set a date and add 30 days to it? I try like this, but it doesn't work:
$date = new DateTime();
$date->setDate(2001, 2, 3);
echo $date->format('Y-m-d');
echo '<br/>';
echo date($date, strtotime('+30 day'));
Answer the question
In order to leave comments, you need to log in
$date = new DateTime('2006-12-12');
$date->modify('+10 day');
echo $date->format('Y-m-d');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question