Tag: simpledateformat

在Excel中显示date表单xlsx在Java中

我将date保存为Excel表格(xlsx)中的一个单元格。 虽然它正在向我展示像2013年6月174日 守则是 String ret=""; if(c.getCellType()==Cell.CELL_TYPE_NUMERIC) { if(col==0) { ret=new java.text.DecimalFormat("0").format(c.getNumericCellValue()); } else if(col==8) { if(HSSFDateUtil.isCellDateFormatted(c)) { DateFormat df=new SimpleDateFormat("DD-MMM-YYYY"); ret=df.format(c.getDateCellValue()); } } else { ret=""+c.getNumericCellValue(); } } else if(c.getCellType()==Cell.CELL_TYPE_STRING) { ret=""+c.getStringCellValue(); } return ret; 请帮助我。 提前致谢。