Opposite of adding months to a java date, this example will demonstrate how to substract a number of months from a date using java's Calendar.add, java 8 date time api, joda’s DateTime.minusMonths and apache commons DateUtils.addMonths. February 6, 2011, the date used in the examples below, was super bowl XLV between Pittsburgh Steelers and Green Bay Packers.
Straight up Java
Output
Java 8 Date and Time API
Java 8 LocalDateTime.minusMonths will return a copy of the LocalDateTime with the specified number of months subtracted.
Output
Joda Time
Joda DateTime.minusMonths will return a copy the DateTime minus the specified number of months.
Output
Apache Commons
Apache commons DateUtils.addMonths will adds a number of months, in this case a negative number of months, to the date returning a new object.