title: NSDate 1 year ago
body: <p>Consider a start date and an end date:</p>
  
  <pre><code>NSDate *startDate, *endDate;
  </code></pre>
  
  <p>For example, startDate could be Dec 10, 2010 and endDate could be Jan 4, 2011.</p>
  
  <p>Consider the span of days from Dec 10, 2010 to Jan 4, 2011.</p>
  
  <p>How could I determine the date range over that same span of days but exactly 1 year ago. And I'd like it to take into consideration leap years. So I'm unable to simply subtract 365 days from each date.</p>
  
  <p>I'd like to end up with:</p>
  
  <pre><code>NSDate *oneYearAgoStartDate, *oneYearAgoEndDate.
  </code></pre>
  
  <p>So maybe in this case, oneYearAgoStartDate would be Dec 10, 2009 and oneYearAgoEndDate would be Jan 4, 2010 (note that I haven't confirmed this).</p>
  
  <p>How could I initialize these two variables to achieve what I need.</p>