title: Reading time values from spreadsheet using poi api
body: <p>I am trying to read a date column and a time column from a spreadsheet. I am able to retireve the date column from the sheet, but not the time column. </p>
  
  <p>For example, my sheet will have rows of the form: </p>
  
  <h2>date                time</h2>
  
  <p>11/2/2012           12:15:01</p>
  
  <p>I have the following code to get the date column: </p>
  
  <pre><code>while(cellIterator.hasNext()) {
              HSSFCell cell = (HSSFCell)cellIterator.next();
              switch(cell.getCellType()){
                  case HSSFCell.CELL_TYPE_NUMERIC:
                      HSSFCellStyle style = cell.getCellStyle();
                      if (HSSFDateUtil.isCellDateFormatted(cell))
                      {
                          d = (Date)getDateValue(cell);
                          SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
                          System.out.println(dateFormat.format(d));
  
                      }
  
  
              }
          }  
  
  protected static Object getDateValue(HSSFCell cellDate) 
  {
  
           double numericDateValue = cellDate.getNumericCellValue();
           Date date = HSSFDateUtil.getJavaDate(numericDateValue);
           return date;
  
  }
  </code></pre>
  
  <p>As you can see I use </p>
  
  <blockquote>
    <p>HSSFDateUtil.isCellDateFormatted(cell)</p>
  </blockquote>
  
  <p>to check if the cell has date value in it. I want to know if i can check if cell has time value using any function. </p>
  
  <p>The excel sheet is coming from an external source. So,i will not be able to make any modifications to the format of it. </p>
  
  <p>Right now, i get the correct date values for date columns. But, for time columns, i am getting </p>
  
  <blockquote>
    <p>12/31/1899</p>
  </blockquote>
  
  <p>as result for all rows</p>