title: c# previous week start date
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/658353/calculate-previous-weeks-start-and-end-date">Calculate previous week&#39;s start and end date</a>  </p>
  </blockquote>
  
  
  
  <p>I need to get the previous week start date in c#
  for eg. today is Jan 9th.
  previous week start date is Jan 1th.</p>
  
  <p>I am using the following code</p>
  
  <pre><code>    DayOfWeek weekStart = DayOfWeek.Sunday;
      DateTime startingDate = DateTime.Today;
  
      while (startingDate.DayOfWeek != weekStart)
          startingDate = startingDate.AddDays(-1);
  
      DateTime previousWeekStart = startingDate.AddDays(-7);
  </code></pre>
  
  <p>Is this the best way in c#</p>
  
  <p>Thanks</p>