title: how to exclude Saturday and Sunday from startDate and endDate datetime objects
body: <p>Developing in c#.I have two DateTime objects. I have to eliminate the Saturday and Sunday from the days count. Lets suppose I have 5 daysincluding Saturday and Sunday. I want to check the days for Saturday Sunday and reduces the days count.</p>
  
  <pre><code> DateTime startDate = DateTime.ParseExact(startDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
   DateTime endDate = DateTime.ParseExact(endDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
   TimeSpan diff = endDate - startDate;
   days = diff.Days;
  </code></pre>
  
  <p>I have tried this,</p>
  
  <p><a href="https://forums.asp.net/t/1142378.aspx?How%20can%20I%20calculate%20the%20Number%20of%20Weekends%20between%20two%20dates" rel="nofollow noreferrer">How can I calculate the Number of Weekends between two dates</a></p>
  
  <p>but i am unable to eliminate saturday sunday as the given link only eliminate the weekends if the dates difference is greater than 7. Haven't got my solution yet.</p>