public static Date substractMonthsFromDate ( final Date date , final int substractMonths ) { final Calendar dateOnCalendar = Calendar . getInstance ( ) ; dateOnCalendar . setTime ( date ) ; dateOnCalendar . add ( Calendar . MONTH , substractMonths * - 1 ) ; return dateOnCalendar . getTime ( ) ; }
Substract months to the given Date object and returns it .