endOfMonth property

DateTime get endOfMonth

Returns the end of the month.

Example:

DateTime(2024, 1, 15).endOfMonth;
// DateTime(2024, 1, 31, 23, 59, 59, 999)

Implementation

DateTime get endOfMonth => DateTime(year, month + 1, 0).endOfDay;