Possible Duplicate:
Compare dates in Java
I need compare two dates date1 and date2, the condition is:
- date1 < date2
- date1 + 14Month <= date2
For the first condition im using if(date2.after(date1))
But for the second I'm not sure...
I'm using Calendar calendar = Calendar.getInstance(); calendar.setTime(fecha1); calendar.add(Calendar.MONTH, +14); Date nuevaFecha1 = (Date) calendar.getTime();
some idea how validate this