How would I get last week Wednesday and next week Wednesday\'s date in C#:
public Form1()
{
InitializeComponent();
CurrentDate.Text = \"Today\'s Date: \" +
This will work. You need to calculate the difference in days between your provided date and the nearest Wednesday, and calculate last/next Wednesday based on whether or not the difference is greater than zero.
int difference = date.DayOfWeek - DayOfWeek.Wednesday;
DateTime lastWednesday = difference > 0 ? date.AddDays(-1 * difference) : date.AddDays(-1 * (7 + difference));
DateTime nextWednesday = lastWednesday.AddDays(7);