https://bz.apache.org/bugzilla/show_bug.cgi?id=58460

            Bug ID: 58460
           Summary: Cell.getDateCellValue() does not document special case
                    when cell value is between 0 and 1
           Product: POI
           Version: 3.11-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: [email protected]
          Reporter: [email protected]

When a cell value is in the interval [0, 1),
org.apache.poi.ss.usermodel.Cell.getDateCellValue() returns a Date with the
date 1899-12-31. This cannot be converted back to an Excel Date as the year is
now less than 1900.

In such a case, the comparison excelDate ==
DateUtil.getExcelDate(DateUtil.getJavaDate(excelDate,false)) also fails.

It is not immediately apparent that excel dates in the interval [0, 1) do not
have an equivalent Date value in Java. A naive user might expect such a value
to be converted to 1900-01-01 xx:xx:xx instead of 1989-12-31 xx:xx:xx.

Please document this behaviour in the getDateCellValue() method and in the
DateUtil class.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to