You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/08/04 04:40:51 UTC

DO NOT REPLY [Bug 45531] New: HSSFDateUtil.getJavaDate() should return Date for negative cell values numbers

https://issues.apache.org/bugzilla/show_bug.cgi?id=45531

           Summary: HSSFDateUtil.getJavaDate() should return Date for
                    negative cell values numbers
           Product: POI
           Version: 3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: ondra@dynawest.cz


HSSFDateUtil.getJavaDate( int ) returns null, because:

isValidExcelDate() returns false for negative numbers.

Although, I've tried filling my great-grandmother's birth date (1.8.1898), and
Excel stores this as a negative number, which is convertible back to Date using
the computation code in getJavaDate(double date, boolean use1904windowing).

Is there some reason for limiting isValidExcelDate() to positive numbers?

I suggest to overload HSSFDateUtil.getJavaDate( int, boolean, boolean ) which
would allow converting negative values to date.

Thanks, Ondra Zizka.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531





--- Comment #5 from Ondra Žižka <on...@dynawest.cz>  2008-08-12 17:55:48 PST ---
Please excuse some delay on my side - I am applying for a job, so I've to focus
that :-)  I will return to the feature request right after. (Posting this
comment to prevent this feat.req. being dismissed.)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531


Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #3 from Josh Micich <jo...@gildedtree.com>  2008-08-06 00:56:02 PST ---
The functionality (storing dates prior to 1900) you are suggesting makes sense,
but it is important to identify exactly what Excel does with the same.

There are different levels of support that POI might provide:
(a) to read every file written by MS Office apps
(b) to produce files readable by MS Office apps
(c) to read files (produced by other apps) which are readable by MS Office
(d) to produce files also readable by other apps
(e) to read files (produced by other apps) which are not readable by MS Office,
but presumably readable by the source app. 
(f) to produce files only readable by other apps

Generally speaking, levels (a)+(b) are high priority, (c)+(d) are low priority
and (e)+(f) are mostly avoided.  There is still not enough information to
classify this functionality request.  If you could do some further
investigation that would be very helpful.  Please upload an OOO and/or Excel
example spreadsheet with pre-1900 dates.

If you want to try writing a patch for this, here is some information about
getting started:
http://poi.apache.org/getinvolved/index.html


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531


Ondra Žižka <on...@dynawest.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|HSSFDateUtil.getJavaDate()  |HSSFDateUtil.getJavaDate()
                   |should return Date for      |should return Date for
                   |negative cell values numbers|negative cell values




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531


Ondra Žižka <on...@dynawest.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




--- Comment #2 from Ondra Žižka <on...@dynawest.cz>  2008-08-05 05:58:00 PST ---
When saving with Excel 2003 SP3, pre-1900 dates behave correctly.
I'll attach the file and check if it uses negative double or some hack.

However, I must admit, that the Excel file I've been trying so far was saved
using OpenOffice.org.

Anyway, POI could be able to read it, using overloaded method... OOo generated
Excel files also count :-)

May I fix the bug? What do I need for it?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531





--- Comment #4 from Ondra Žižka <on...@dynawest.cz>  2008-08-07 02:21:01 PST ---
Created an attachment (id=22399)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22399)
XLS file from OpenOffice 2.4.1 stored as Excel 97/2000/XP file

One column with dates 1.1.1898 to 1.1.1930.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531


Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #1 from Josh Micich <jo...@gildedtree.com>  2008-08-04 01:10:23 PST ---
This may be a limitation of Excel (I am having trouble entering dates prior to
1900).  If I am mistaken about this, can you please upload an example
spreadsheet with a pre-1900 date stored in one of the cells?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 45531] HSSFDateUtil.getJavaDate() should return Date for negative cell values numbers

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45531


Ondra Žižka <on...@dynawest.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ondra@dynawest.cz




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org