CSharp examples for System:DateTime Day
Get Monday Of This Week
using System.Web; using System.Linq; using System.Collections.Generic; using System;/*from www .j av a 2s . c om*/ public class Main{ public static DateTime GetMondayOfThisWeek(DateTime today) { int dayOfWeek = Convert.ToInt32(today.DayOfWeek.ToString("d")); if (dayOfWeek == 0) dayOfWeek = 7; return today.AddDays(1-dayOfWeek); } }