Gets the end of week.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cmoss.Util { public class DateFunctions { /// <summary> /// Gets the end of week. /// </summary> /// <param name="date">The date.</param> /// <returns></returns> public static DateTime GetEndOfWeek(DateTime date) { int dayOfWeek = (int)date.DayOfWeek; return new DateTime(new DateTime(date.Year, date.Month, date.Day + (7 - dayOfWeek)).Ticks - 1); } } }