I need help finding the second Wednesday of the year. Here is what I have done, but it doesn’t seem to work.
DateTime baseDay = new DateTime(DateTime.Now.Year, 1, 5);
int secondWed = 5 + ((12 - (int)baseDay.DayOfWeek) % 7);
DateTime fullDate = new DateTime(DateTime.Now.Year, 1, secondWed);
Based on the very good answer by Mark Ransom to How to find the 3rd Friday in a month with C#?. There is no looping here.
You can merge the last two lines into one for slightly better performance.