Useful PHP Codes
Increment a Date by Month, Day or Year
Increment by month
-
-
$time = strtotime("2014-12-11");
$d = date("Y-m-d", strtotime("+1 month", $time));
-
Increment by day
-
$time = strtotime("2014-12-11");
$d = date("Y-m-d", strtotime("+1 day", $time));
Increment by year
-
$time = strtotime("2014-12-11");
$d = date("Y-m-d", strtotime("+1 year", $time));