Here's the simple example (today is 2016-08-29):
var_dump(Carbon::now());
var_dump(Carbon::now()->addMonths(6));
Output:
object(Carbon\Carbon)#303 (3) {
["date"] => string(26) "2016-08-29 15:37:11.000000"
}
object(Carbon\Carbon)#303 (3) {
["date"] => string(26) "2017-03-01 15:37:11.000000"
}
For Carbon::now()->addMonths(6)
I'm expecting 2017-02-29
, not 2017-03-01
.
Am I missing something about date modifications?