通过Calendar 类获取前一个月的第一天
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
//获取到当前的时间
Calendar calendar1 = Calendar.getInstance();
//获取前一个月
calendar1.add(Calendar.MONTH, -1);
//获取到月的第一天
calendar1.set(Calendar.DAY_OF_MONTH,1);
String sBeginTime = time.format(calendar1.getTime());
Calendar calendar2 = Calendar.getInstance();
//获取到当前月的第一天
calendar2.set(Calendar.DAY_OF_MONTH,1);
String sEndTime = time.format(calendar2.getTime());