Given a date I would like to calculate the weekending (Friday) for a week starting from Saturday and ending Friday.
I tried the following but having problems with February, 02/26/2011 is giving 02/25/2011 onstead of 03/04/2011
System.DateTime weekStart = thedate.AddDays(-Convert.ToInt32(theDate.DayOfWeek) - 1);
System.DateTime weekEnd = weekStart.AddDays(6);
Interaction.MsgBox(weekEnd.ToString());
When you pass in a Saturday, you are subtracting 7 days instead of using that day itself.