Bug 55295 - DateUtil.isCellDateFormatted should probably handle data format "reserved-0x1c"
Summary: DateUtil.isCellDateFormatted should probably handle data format "reserved-0x1c"
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.9-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-23 07:27 UTC by thilo
Modified: 2015-06-01 21:27 UTC (History)
0 users



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). (7.50 KB, application/vnd.ms-excel)
2013-07-23 10:15 UTC, thilo
Details

Note You need to log in before you can comment on or make changes to this bug.
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).