endOfMonth property
DateTime
get
endOfMonth
The last day of the month that contains this date.
DateTime(2025, 6, 15).endOfMonth; // DateTime(2025, 6, 30)
Implementation
DateTime get endOfMonth => DateTime(year, month + 1, 0);