Bug 55295

Summary: DateUtil.isCellDateFormatted should probably handle data format "reserved-0x1c"
Product: POI Reporter: thilo
Component: HSSFAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 3.9-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: stripped down version of the problematic file, edited with Excel 2003 on XP. Now shows a different behaviour (but still not working properly with POI).

Description thilo 2013-07-23 07:27:05 UTC
I have an Excel file with dates in them. The internal numeric value can be retrieved correctly, but DateUtil.isCellDateFormatted does not recognize it as a date format.

Debugging, it fails at

public static boolean isADateFormat(int formatIndex, String formatString) {

where formatString is "reserved-0x1c"

I could find no good documentation on that format string (and unfortunately cannot share the file in question), but it seems to be a date format used by Chinese versions of Excel.

LibreOffice correctly shows it as a date (but OS X Preview does not -- shows up as a number).
Comment 1 Nick Burch 2013-07-23 09:15:28 UTC
Are you able to give us a few examples of the formats it produces?
Comment 2 thilo 2013-07-23 10:13:23 UTC
The original file (with formatString "reserved-0x1c") is a customer file and I cannot share that. 

I tried editing it down to cut out everything except the date cells, but it seems that this changed how the dates are being represented. I used Microsoft Excel 2003 on Windows XP (I do not know which version of Windows or Office the original was made with).

I am attaching this edited file anyway, because it does not parse with POI either. It still displays as a date in LibreOffice (07/23/2013) and now also in OS X Preview (as AD2013年7月23日, whereas in the original file it displayed as 41478).
Comment 3 thilo 2013-07-23 10:15:34 UTC
Created attachment 30614 [details]
stripped down version of the problematic file, edited with Excel 2003 on XP. Now shows a different behaviour (but still not working properly with POI).