code: public static CompareDates compareTwoDates(Date date1, Date date2) {
  		Date d1 = new Date(date1.getTime());// to unify the format of the dates
  											// before the compare
  		Date d2 = new Date(date2.getTime());
  		if (d1.compareTo(d2) < 0)
  			return CompareDates.DATE1_LESS_THAN_DATE2;
  		else if (d1.compareTo(d2) > 0)
  			return CompareDates.DATE1_GREATER_THAN_DATE2;
  		else
  			return CompareDates.DATE1_EQUAL_DATE2;
  	}
docs: Compare two dates.
  
  @param date1 the date 1
  @param date2 the date 2
  @return the compare dates