What is the best way to calculate the previous week\'s start and end date in C#? I.e. today 18 March would result in 9 March (Monday last week) and 15 March (Sunday last we
You can skip the while loop and use
DateTime mondayOfLastWeek = date.AddDays( -(int)date.DayOfWeek - 6 );
This assumes you're using Monday as the first day of the week.