Algorithm to get 13 months back given a date?
The user will enter in a date like 10/31/2015 and I'll call another UBE section and pass it 2 variables, begin date and end date for 13 months back.
For example, given the date 10/31/2015, I'll call another UBE section 13 times and pass in the begin and end dates like below
10/1/2015, 10/31/2015
9/1/2015, 9/30/2015
8/1/2015, 8/31/2015
7/1/2015, 7/31/2015
6/1/2015, 6/30/2015
5/1/2015, 5/31/2015
4/1/2015, 4/30/2015
3/1/2015, 3/31/2015
2/1/2015, 2/28/2015
1/1/2015, 1/31/2015
12/1/2014, 12/31/2014
11/1/2014, 11/30/2014
10/1/2014, 10/31/2014
Do you know of a good algorithm to get what I want above?
Thanks