B-219 Sec-55 Noida, India
+918010221733

How to add days, weeks, months to any date in magento ?

$date = date("Y-m-d"); // current date
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 day");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 week");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +2 week");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 month");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +30 days");
(Visited 1,143 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.