Peter Ordonez Peter Ordonez - 1 month ago 9
PHP Question

CodeIgniter : add 3 days to date fetched from database

My database table for date is lead_dateuploaded

$uploadDate = $date['lead_dateuploaded'];
// date format is (2016-10-20)


How can i add 3 days on that fetched data from database? im using CodeIgniter.

Answer

Think this will work.

$uploadDate = '2016-10-20';
$date = strtotime($uploadDate);
$date = strtotime("+3 day", $date);
$date = date('Y-m-d', $date);
echo $date;