how to print the exact date cell value in the exce

2019-02-13 22:32发布

问题:

I am using apache poi 3.5 for extracting data from the excel sheet.i having the date cell formatted in mm/dd/yyyy.

If i print using cell.getDateCellValue() then print the date in other format.so, i want to print the date that is in the actual format of excel sheet cell.

how i do it..Please guide me way to do it....

Saravanan

回答1:

just call the method formatCellValue(Cell), formatCellValue(cell, formulaEvaluator) in the DataFormatter class. It will print the value as it is in the excel sheet.

formatCellValue(cell, formulaEvalator) for formula cells...



标签: apache-poi