title: If I have a specific date of a day, how do I get the date of that day in the previous week?
body: <p>SEE ANSWER FROM @Basil Bourque for most up to date answer</p>
  
  <hr>
  
  <p>For example, if I have a "Date" variable "date1" with a value of (dd/mm/yyy) 03/07/2011, which is a Sunday. How do I get the "Date" of the previous Sunday "date2"? which would have the value (dd/mm/yyyy) 26/06/2011. </p>
  
  <p>Is there an easy way of doing it, for example:</p>
  
  <p>pseudo code:</p>
  
  <pre><code>Date date1 = (03/07/2011);
  Date date2 = date1.subtractNumberOfDays(7);
  </code></pre>