SimpleDateFormat format =
new
SimpleDateFormat(
"yyyy-MM-dd"
);
Calendar cal_1=Calendar.getInstance();
cal_1.add(Calendar.MONTH, -
1
);
cal_1.set(Calendar.DAY_OF_MONTH,
1
);
firstDay = format.format(cal_1.getTime());
System.out.println(
"-----1------firstDay:"
+firstDay);
Calendar cale = Calendar.getInstance();
cale.set(Calendar.DAY_OF_MONTH,
0
);
lastDay = format.format(cale.getTime());
System.out.println(
"-----2------lastDay:"
+lastDay);
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH,
0
);
c.set(Calendar.DAY_OF_MONTH,
1
);
String first = format.format(c.getTime());
System.out.println(
"===============first:"
+first);
Calendar ca = Calendar.getInstance();
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
String last = format.format(ca.getTime());
System.out.println(
"===============last:"
+last);