Bug 14375 - [PATCH] Fix for reading files that use 1904 date windowing
Summary: [PATCH] Fix for reading files that use 1904 date windowing
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-dev
Hardware: Other other
: P3 normal with 2 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-07 23:23 UTC by Dan Sherman
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Handle both 1900 and 1904 date windowing - patches to Workbook, HSSFCell, and HSSFDateUtil (7.12 KB, patch)
2002-11-07 23:25 UTC, Dan Sherman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Sherman 2002-11-07 23:23:08 UTC
Files created in Excel for Macintosh, by default, save workbooks with all date cell values 
using 1904 date windowing.  HSSFDateUtil assumes 1900 windowing, thus converts 
these dates incorrectly.  Patch includes changes to Workbook.java, HSSFCell.java, and 
HSSFDateUtil.java to correctly identify whether 1900 or 1904 windowing is being used 
and do the correct conversion.  Also adds some additional internal date formats to 
HSSFDateUtil.isInternalDateFormat(int).
Comment 1 Dan Sherman 2002-11-07 23:25:33 UTC
Created attachment 3769 [details]
Handle both 1900 and 1904 date windowing - patches to Workbook, HSSFCell, and HSSFDateUtil
Comment 2 Andy Oliver 2002-11-28 19:34:21 UTC
Done, applied.  You know if we had a unit test for it, then we might not break
it later..  (So far just about EVERY thing that doesn't have a unit test has
been broken from time to time...the unit tested code has stayed clean!)
Comment 3 Avik Sengupta 2004-01-01 08:58:36 UTC
Reverted the internal date format addition, since they caused 24125. 
Tho only 0xaa and 0xac have been reported incorrect, have reverted the whole set
(0xa4 to 0xad) since we cant now say which ones are suspect! 
Comment 4 Avik Sengupta 2004-01-01 09:01:49 UTC
even a7-ab has been reported to be percentage formats.. so best to keep the
whole set out.