Let\'s say I have a date in the following format: 2010-12-11 (year-mon-day)
With PHP, I want to increment the date by one month, and I want the year to be automatica
Use DateTime::add.
$start = new DateTime("2010-12-11", new DateTimeZone("UTC")); $month_later = clone $start; $month_later->add(new DateInterval("P1M"));
I used clone because add modifies the original object, which might not be desired.