How to Add 7 Days to Current Date in Magento 1

datelocalemagento-1

I need to save to db current date & "current date + 7days" values. For this I'm using following function. But how to add 7 days to this.

 Mage::getModel('core/date')->date('Y-m-d H:i:s');

Thanks in advance.

Update:

$res = Mage::getModel('rad_inventorypieces/reserve');
$date = new Zend_Date(Mage::getModel('core/date')->timestamp());
$res->setCreatedDate($date);
$date->addDay('7');
$res->setExpiryDate($date);

Best Answer

In OOP style:

$date = new Zend_Date(Mage::getModel('core/date')->timestamp());
$date->addDay('7');
$date->toString('YYYY-MM-dd HH:mm:ss'); //Returns representation of date 
Related Topic