Opposite of adding days to a java date, this example will demonstrate how to substract a day from a date using java's Calendar.add, java 8 date time api, joda’s DateTime.minusDays and apache commons DateUtils.addDays. 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 LocalDate.minusDays will return a copy of the LocalDate with the specified number of days subtracted.
Output
Joda Time
Joda DateTime.minusDays will return a copy the DateTime minus the specified number of days.
Output
Apache Commons
Apache commons DateUtils.addDays will adds a number of days, in this case a negative number of days, to the date returning a new object.