I'm importing an excel file with many rows. Some columns are dates and i have to read them as such but the format of the cell is not correctly read by Apache poi. Indeed the dates have to be dd/MM/YYYY but when i have 04/13/2017 the Apache poi library thinks it is in the format MM/dd/YYYY, and reads the date consequently.
How can i tell apache poi to read dates in the right format?
Below there is an example of my code:
case Cell.CELL_TYPE_NUMERIC:
if (DateUtil.isCellDateFormatted(cell)) {
Date d = cell.getDateCellValue());
System.out.println(myWorkBook.getSheetName(i) + " " + cell.getNumericCellValue() + "\t");
}
04/13/2017
is not a valid date int he formatdd/MM/yyyy
? – XtremeBaumer