JAVA如何根据Date对象获取时间是上午还是下午?
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
String format = simpleDateFormat.format(date);
if(Integer.parseInt(format)<12){
rows.createCell(6).setCellValue("上午");
}else {
rows.createCell(6).setCellValue("下午");
}


浙公网安备 33010602011771号