Given a date (of type DateTime), how do I find the 3rd Friday in the month of that date?
DateTime
Here is my two cents... An optimized solution without unnecessary loops or tests :
public static DateTime ThirdFridayOfMonth(DateTime dateTime) { int day = dateTime.Day; return dateTime.AddDays(21 - day - ((int)dateTime.DayOfWeek + 37 - day) % 7); }