When setting a cell's value to Jan 1, 1990 without a time the returned value doesn't return the doesn't return the same date. It returns a date one date later on Jan 2, 1990. Calendar cal = Calendar.getInstance(); // A pseduo special Excel dates cal.set(1900, 0, 1); Date valueToTest = cal.getTime(); HSSFCell cell = getNewCell(); cell.setCellValue(valueToTest);
Created attachment 6292 [details] JUnit that shows bug.
good stuff with the unit tests..ill look at this soon (tm).
Excel handles (incorrectly) the year 1900 as a leap year, so the serial numbers from January 1 to March 1 of that year may be off by one.
Should be looked out...sounds like an Excel bug.... REgardless its not serious enough to hold up 2.0
The Summary and initial description stated 1990 was the issue, but the unit test and subsequent comments show the problem as being with the year 1900. Changed the summary to reflect that that it is an issue with 1900 not 1990.
The latest POI 3.5-beta4 works properly. Yegor