Question: Anyone know a simple way using Java calendar to subtract X days from a date?

I have not been able to find any function which allows me to directly subtract X days from a date in Java. Can someone point me to the right direction?

Answer: 
Taken from [the docs here](http://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#add%28int,%20int%29): 

> 
> Adds or subtracts the specified amount of time to the given calendar field, based on the calendar's rules. For example, to subtract 5 days from the current time of the calendar, you can achieve it by calling:
> 
> 
> 
> ```
> Calendar calendar = Calendar.getInstance(); // this would default to now
> calendar.add(Calendar.DAY_OF_MONTH, -5).
> 
> ```
> 
>
Instead of writing my own `addDays` as suggested by Eli, I would prefer to use `DateUtils` from **Apache**. It is handy especially when you have to use it multiple places in your project.

The API says: 

`addDays(Date date, int amount)` 

Adds a number of days to a date returning a new object.

Note that it returns a new `Date` object and does not make changes to the previous one itself.