code: public String formatNumberDateCell(CellValueRecordInterface cell) {
          double value;
          if (cell instanceof NumberRecord) {
              value = ((NumberRecord) cell).getValue();
          } else if (cell instanceof FormulaRecord) {
              value = ((FormulaRecord) cell).getValue();
          } else {
              throw new IllegalArgumentException("Unsupported CellValue Record passed in " + cell);
          }
  
          // Get the built in format, if there is one
          int formatIndex = getFormatIndex(cell);
          String formatString = getFormatString(cell);
  
          if (formatString == null) {
              return _defaultFormat.format(value);
          }
          // Format, using the nice new
          // HSSFDataFormatter to do the work for us
          return this.formatRawCellContents(value, formatIndex, formatString);
      }
docs: Formats the given numeric of date cells contents as a String, in as
  close as we can to the way that Excel would do so. Uses the various
  format records to manage this.
  <p>
  TODO - move this to a central class in such a way that hssf.usermodel can
  make use of it too
  
  @param cell the cell
  @return the given numeric of date cells contents as a String