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 2006/05/03 17:42:56 UTC

DO NOT REPLY [Bug 39472] New: - Wrong behaviour when setting cell value to dates between 1900-01-01 and 1900-02-28

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39472>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39472

           Summary: Wrong behaviour when setting cell value to dates between
                    1900-01-01 and 1900-02-28
           Product: POI
           Version: 2.5
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: cosmacol@yahoo.it


Try to set a cell value using the HSSFCell.setCellValue(java.util.Date) to a
date that is between 1900-01-01 and 1900-02-27, you'll get a value with a +1
than the correct one.

All dates between 1900-01-01 and 1900-01-27 get shifted with a +1.

>From day 61 onwards (1900-03-01) the problem doesn't appear due to an Excel
strange behaviour: it seems to consider 1900 as a lap year (while it isn't), so
it diplay day 60 as 29/02/1900. So the two problems compensate each other.

Ex.
getExcelDate(1900-01-01) --> 2  (excel display as Jan 1, 1900)
getExcelDate(1900-01-02) --> 3  (excel display as Jan 2, 1900)
getExcelDate(1900-01-03) --> 4  (excel display as Jan 3, 1900)
...
getExcelDate(1900-02-27) --> 59 (excel display as Feb 28, 1900)
getExcelDate(1900-02-28) --> 60 (excel display as Feb 29, 1900!!)
getExcelDate(1900-03-01) --> 61 (excel display as Mar 03, 1900)

A fix should take into account the excel problem without breaking the first two
months.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


DO NOT REPLY [Bug 39472] - Wrong behaviour when setting cell value to dates between 1900-01-01 and 1900-02-28

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39472>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39472


cosmacol@yahoo.it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1




------- Additional Comments From cosmacol@yahoo.it  2006-05-04 07:44 -------
(In reply to comment #0)
Only to correct an error in the description, the ex. table should look like this:

Ex.
getExcelDate(1900-01-01) --> 2  (excel display as Jan 2, 1900)
getExcelDate(1900-01-02) --> 3  (excel display as Jan 3, 1900)
getExcelDate(1900-01-03) --> 4  (excel display as Jan 4, 1900)
...
getExcelDate(1900-02-27) --> 59 (excel display as Feb 28, 1900)
getExcelDate(1900-02-28) --> 60 (excel display as Feb 29, 1900!!)
getExcelDate(1900-03-01) --> 61 (excel display as Mar 03, 1900)


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

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/