java算法:通过输入年份和月份生成每一天的格式化日期字符串
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String year = "2023";
String month = "11";
int len = month.length();
String temp = null;
if (len != 2){
temp = year + "-" + "0" + month;
}else {
temp = year + "-" + month;
}
for (int i = 1; i < 32; i++){
String date = null;
if (String.valueOf(i).length() != 2){
date = temp + "-" + "0" + String.valueOf(i);
}else {
date = temp + "-" + String.valueOf(i);
}
System.out.println(date);
}