apache poi DataFormatter on cell containing date

后端 未结 1 1064
礼貌的吻别
礼貌的吻别 2021-01-17 04:50

Good day.

I needed to get cell data from excel files as they look like and bumped to DataFormatter class of apache poi. This works like a charm except f

1条回答
  •  囚心锁ツ
    2021-01-17 05:15

    For fetching the date in desired format you can use following:

      SimpleDateFormat DtFormat = new SimpleDateFormat("dd/MM/yyyy");
      Date date=Test.getRow(RowNum).getCell(CellNum).getDateCellValue();
      System.out.println(DtFormat.format(date).toString());
    

    And now if the cell value is 05/03/2013, it will give o/p as 05/03/2013. I hope this will resolve your problem.

    0 讨论(0)
提交回复
热议问题