java根据年月获取当前月的每一天日期
public static List<String> getDayByMonth(int yearParam,int monthParam){
List list = new ArrayList();
Calendar aCalendar = Calendar.getInstance(Locale.CHINA);
aCalendar.set(yearParam,monthParam,1);
int year = aCalendar.get(Calendar.YEAR);//年份
int month = aCalendar.get(Calendar.MONTH) + 1;//月份
int day = aCalendar.getActualMaximum(Calendar.DATE);
for (int i = 1; i <= day; i++) {
String aDate=null;
if(month<10&&i<10){
aDate = String.valueOf(year)+"-0"+month+"-0"+i;
}
if(month<10&&i>=10){
aDate = String.valueOf(year)+"-0"+month+"-"+i;
}
if(month>=10&&i<10){
aDate = String.valueOf(year)+"-"+month+"-0"+i;
}
if(month>=10&&i>=10){
aDate = String.valueOf(year)+"-"+month+"-"+i;
}
list.add(aDate);
}
return list;
}