SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH,
cal.getActualMinimum(Calendar.DAY_OF_MONTH));
String beforeMonth = sdf.format(cal.getTime());
return beforeMonth;