How to add days, weeks, months to any date in PHP
$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");
To subtract just use – instead of +.
In PHP>=5.3.0 you can use the DateTime functions.

Blog
Recent Posts
Live Help
Chat to a member of our sales support team live, now, to answer all of your questions.
Categories