I am saving dates like so: 2013-11-06 using date function
date("Y-m-d")
Would like to add three days to the date. Would I need to use strtotime() for this?
I am saving dates like so: 2013-11-06 using date function
date("Y-m-d")
Would like to add three days to the date. Would I need to use strtotime() for this?
$datetime = new DateTime('2013-01-22');
$datetime->modify('+1 day');
echo $datetime->format('Y-m-d H:i:s');
you may find here more Date time
Here you go
echo date('Y-m-d', strtotime("+3 days"));
Here, really easy:
$date=date("Y-m-d");
$date_plus_3_days=date("Y-m-d", strtotime("+3 days"));
strtotime
can do lots of other related things: PHP.net documentation.
You can also use this.
$date = new DateTime(date("Y-m-d"));
$date->add(new DateInterval('P3D'));
echo $date->format('Y-m-d');