Consider a start date and an end date:
NSDate *startDate, *endDate;
For example, startDate could be Dec 10, 2010 and endDate could be Jan 4, 2011.
Consider the span of days from Dec 10, 2010 to Jan 4, 2011.
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.
I'd like to end up with:
NSDate *oneYearAgoStartDate, *oneYearAgoEndDate.
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).
How could I initialize these two variables to achieve what I need.