Answers for "how to read date cell value in excel using java"

1

poi reading date as number

XSSFWorkbook workbook = new XSSFWorkbook(new File(result));
    XSSFSheet sheet = workbook.getSheetAt(0);

    // Iterate through each rows one by one
    Iterator<Row> rowIterator = sheet.iterator();
    while (rowIterator.hasNext()) {
        Row row = rowIterator.next();
        // For each row, iterate through all the columns
        Iterator<Cell> cellIterator = row.cellIterator();

        while (cellIterator.hasNext()) {
            Cell cell = cellIterator.next();
            switch (cell.getCellType()) {
            case Cell.CELL_TYPE_NUMERIC:
                if (cell.getNumericCellValue() != 0) {
                    //Get date
                    Date date = row.getCell(0).getDateCellValue();



                    //Get datetime
                    cell.getDateCellValue()


                    System.out.println(date.getTime());
                }
                break;
            }
        }
    }
Posted by: Guest on April-06-2020
0

how to read date cell value in excel using java

12/8/20201
4/6/2021
Posted by: Guest on September-27-2021

Code answers related to "how to read date cell value in excel using java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language