title: How do I determine if a given date is the Nth weekday of the month?
body: <p>Here is what I am trying to do:
  Given a date, a day of the week, and an integer <code>n</code>, determine whether the date is the <code>n</code>th day of the month.</p>
  
  <p>For example:</p>
  
  <ul>
  <li><p>input of <code>1/1/2009,Monday,2</code>
  would be false because <code>1/1/2009</code> is not the second Monday</p></li>
  <li><p>input of 
  <code>11/13/2008,Thursday,2</code>
  would return true because it is the second Thursday</p></li>
  </ul>
  
  <p>How can I improve this implementation?</p>
  
  <pre><code>private bool NthDayOfMonth(DateTime date, DayOfWeek dow, int n)
  {
      int d = date.Day;
      return date.DayOfWeek == dow &amp;&amp; (d/ 7 == n || (d/ 7 == (n - 1) &amp;&amp; d % 7 &gt; 0));
  }
  </code></pre>