1 回答
TA贡献1921条经验 获得超9个赞
这是你的代码的工作2018
for (int dec = 1; dec <= maxDay; dec++) {
Row row3 = sheet.getRow(dec + 2);
Cell cell1 = row3 .createCell(2);
cal1.set(Calendar.YEAR, 2018);
cal1.set(Calendar.MONTH, 11);
cal1.set(Calendar.DAY_OF_MONTH, 1);
cal1.set(Calendar.DAY_OF_MONTH, dec);
java.util.Date date1 = cal1.getTime();
cell1.setCellValue(formatter.format(date1));
}
所以要继续在此之下,首先使用相同的代码并更改需要更改的内容是合乎逻辑的
for (int notdec = 1; notdec <= 365; notdec++) {
Row row3 = sheet.getRow(maxDay +3 + notdec); // THIS
Cell cell1 = row3.createCell(2); // THIS
cal1.set(Calendar.YEAR, 2019); // THIS
cal1.set(Calendar.DAY_OF_YEAR, notdec); // THIS
java.util.Date date1 = cal1.getTime();
cell1.setCellValue(formatter.format(date1));
}
由于您尚未输入所需的输出,我猜这可能是您想要的
添加回答
举报