//Excel中日期格式转换 private Date cellToDate(Cell dateCell){ if(0==dateCell.getCellType()){ if(DateUtil.isCellDateFormatted(dateCell)){ //用于转化为日期格式 Date d = dateCell.getDateCellValue(); DateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date = formater.format(d); return DateUtils.formatStringToDate(date, DateUtils.YYYY_MM_DDHHMMSS); } } return null; }
java读取Excel中日期格式转换工具
最新推荐文章于 2023-01-09 16:52:53 发布