Compare two dates

Hi, I have two dates:

  • evaluationDate: a date retrieved from my Evaluation entity
  • today: which is a new Date()

Now, I want to check if the evaluationDate < (today minus 2 months).

How can I best do this? I can’t find functions to subtract months and to check the dateDiff or something. Thanks in advance.

I already came up with a way to do this. I’ve used:

Date today = new Date();
Date twoMonthsAgo = DateUtils.addMonths(today,-2);

if( evaluationDate.compareTo(twoMonthsAgo) < 0) {