Carbon Parse Last Day of Month

Created on 11 Oct 2016  路  4Comments  路  Source: briannesbitt/Carbon

On parsing the last second of the month, you get back the next day.

Carbon::parse('2016-09-31 23:59:59')->toDateTimeString() => "2016-10-01 23:59:59"

Most helpful comment

I think this is already the purpose of ->daysInMonth and ->endOfMonth() ?

All 4 comments

Unfortunately there are only 30 days in September ;-)

@lucasmichot oops! My bad. still would be nice to return ->lastDayOfMonth().

Thanks!

I think this is already the purpose of ->daysInMonth and ->endOfMonth() ?

Can this be closed @rohstar ?

Was this page helpful?
0 / 5 - 0 ratings