EndOfTheDay
Returns datetime corresponding to day end
Source
public static DateTime EndOfTheDay(this DateTime date)
{
return new DateTime(date.Year, date.Month, date.Day, 23, 59, 59, 999);
}
Example
var endOfTheDay = DateTime.Now.EndOfTheDay();