I am using Apache POI 3.6, I wish to read an stand out file getting date like "8/23/1991".

 switch (cell.getCellType()) {


     value = "NUMERIC value=" + cell.getNumericCellValue();



However it takes the number value type and returns the worthiness such as this "33473.". I have attempted some level(within the Number Cell Type),

  dbltemp=row.getCell(c, Row.CREATE_NULL_AS_BLANK).getNumericCellValue();

                        if(c == 6 || c == 9)  {
                            strTemp= new String(dbltemp.toString().trim());

                            long tempDate = Long.parseLong(strTemp);
                            Date date=new Date(tempDate);


yet I can not think it is.

Thank you for individuals who are able to help....

Knowing which cell i.e. column position say in every row will probably be to start dating ?, apply for row.getCell(0).getDateCellValue() directly.

For any more generic situation, look at this code example for handling CELL_TYPE_NUMERIC into a date, line 151 let's start

UPDATE: Here's a good example - you are able to apply this inside your switch situation code above. I'm checking and printing the Number in addition to Date value. Within this situation the very first column during my sheet has dates, hence I personally use row.getCell().

You should use the if (HSSFDateUtil.isCellDateFormatted .. code block directly inside your switch situation.

if (row.getCell(0).getCellType() == HSSFCell.CELL_TYPE_NUMERIC)
    System.out.println ("Row No.: " + row.getRowNum ()+ " " + row.getCell(0).getNumericCellValue());

                 if (HSSFDateUtil.isCellDateFormatted(row.getCell(0)))

                 System.out.println ("Row No.: " + row.getRowNum ()+ " " + row.getCell(0).getDateCellValue());


the output is

Row No.: 0 39281.0
Row No.: 0 Wed Jul 18 00:00:00 IST 2007
Row No.: 1 39491.0
Row No.: 1 Wed Feb 13 00:00:00 IST 2008
Row No.: 2 39311.0
Row No.: 2 Fri Aug 17 00:00:00 IST 2007

You'll need the DateUtils: see this article for particulars.

Or, even better, use Andy Khan's JExcel rather than POI.