Posted By:
AlessandroA_Garbagnati
Posted On:
Tuesday, August 28, 2001 09:59 AM
Morgan,
You problem is that in the SimpleDateFormat, 'mm' means minutes, while you are looking for 'MM' (month).
You can use either roll or, eventually, the add() method (obviously, if you want to subtract days you need to use a negative amount):
...
rcal.add(Calendar.DATE, -2);
Date curDate = rcal.getTime();
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
return sdf1.format(curDate);