Actually, roll() won't give you "yesterday's" or "tomorrow's" date when working with a date where the value of its subject field is at the beginning or end of the month of its range.
For example, roll(Calendar.DATE, false) will change a Calendar object from August 1 to August 31, not to July 31.
Calendar.add() is the method of choice.
Hello,
I am doing it like this
SimpleDateFormat formatExp = new SimpleDateFormat ("MM-dd-yyyy");
Date expirationdate = new Date();
try {
expirationdate = formatExp.parse(s3ppEffect);
}
catch(ParseException e){
System.out.println(" DATE NOT FOUND " );
}
java.util.Calendar dbEffDate = Calendar.getInstance();
dbEffDate.setTime(expirationdate);
java.util.Calendar.add(dbEffDate.setTime(expirationdate), -1);
add is expectin (int, int) not (date, int)
any ideas thanks