IsLastDayOfTheMonth
Returns whether the given date is the last day of the month.
Source
public static bool IsLastDayOfTheMonth(this DateTime dateTime)
{
return dateTime == new DateTime(dateTime.Year, dateTime.Month, 1).AddMonths(1).AddDays(-1);
}
Example
var isLastDay = DateTime.Now.IsLastDayOfTheMonth()