Bug 44286 - [EDITING] Calc decreases one day of a date typed (depends on timezone, e.g. Brazilian historical timezone)
Summary: [EDITING] Calc decreases one day of a date typed (depends on timezone, e.g. B...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.0 Beta2
Hardware: Other Windows (All)
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:4.1.0 target:4.0.2 target:3.6.6
Keywords:
: 44367 46047 52619 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-29 12:18 UTC by Gustavo Pacheco
Modified: 2013-04-16 10:18 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Pacheco 2011-12-29 12:18:10 UTC
This bug was found on LibreOffice 3.5.0 beta2/Windows XP SP3 with Brazilian-portuguese locale setting and timezone GMT+03:00 (Brasilia).

After setting the system with the configuration above, open a new spreadsheet and type the date 22/04/1902 (the Brazilian standard date format is DD/MM/YYYY). 

Calc will print 21/04/02, one day decreased from original date.

I found the error in dates between 27/04/1900 and 01/01/1904.

Thanks!
Gustavo Pacheco.
Comment 1 Rainer Bielefeld Retired 2012-01-01 08:50:26 UTC
NOT reproducible with Parallel Dev-Installation of  "LibreOffice 3.5.0 Beta2- WIN7 Home Premium (64bit) German UI/Localization [Build-ID : 8589e48-760cc4d-f39cf3d-1b2857e-60db978] 

NOT reproducible with same version German UI/ Pt-Br Localization.

Linux related?
Comment 2 Rainer Bielefeld Retired 2012-01-01 10:46:41 UTC
@Gustavo Pacheco:
Can you please check "Bug 44367 - EDITING: Wrong display when inputting/viewing dates before 1.1.1900"?
Comment 3 Gustavo Pacheco 2012-01-01 13:49:43 UTC
Hi Rainer! Thanks for the tests! Happy new 2012! :) 

I get the bug only in Windows XP machines. At this time, no Linux. 

It´s an old bug. I recovered it to my Bug Hunting check list. Olivier Hallot and I told about it to Eike Rathke in the OpenOffice.org Conference 2010. Eike checked the bug and explained some timezone issues to us (I suggest include him here or assign this bug to him). There are some information in these old OOo issues:

https://issues.apache.org/ooo/show_bug.cgi?id=86094
https://issues.apache.org/ooo/show_bug.cgi?id=105864

I think 44367 is a similar bug (however, I didn't get reproduce it, maybe due different operational system configuration).
Comment 4 Gustavo Pacheco 2012-01-03 04:29:16 UTC
 I recorded a video about that (on LibreOffice 3.5.0beta2/Windows XP). 

 Please, open http://www.youtube.com/watch?v=K6pCHnmbr24 (always use this url, it's an unlisted video). The bug occurs between 27/04/1900 and 01/01/1914 (not 1904).
Comment 5 Eliane Domingos de Sousa 2012-01-03 05:14:28 UTC
Hello!!! 

Happy new year!!!!

As I can see, the bug exists in the windows plataform, I made a test in the Windows XP 32 bits SP3 PT-BR timezone GMT+03:00 (Brasilia) and Window 7 32 bits SP1 PT-BR timezone GMT+03:00 (Brasilia).

I made a test in the Linux too, Ubuntu 64 bits 11.04, PT-BR timezone GMT_03:00 (Brasilia), and it works correctly.

For the test in all plataforms, I used LibreOffice 3.5.0 Beta 2
Comment 6 Rainer Bielefeld Retired 2012-01-04 11:05:31 UTC
I doubt that there is a relation, but can you please check whether "Bug 44453 - FILESAVE FILEOPEN .xls: EXCEL Leap year bug has to be mentioned" has relevant information for the problem here?
Comment 7 Gustavo Pacheco 2012-01-11 09:56:56 UTC
I read Eike's explanation. Unfortunately, I can't confirm if there is some relation between the bugs. For me, apparently, not.
Comment 8 Eike Rathke 2012-01-13 13:22:39 UTC
This may indeed be related to historical timezone data, having a similar cause as the bugs mentioned (though not the Excel leap year thing). However, I was not able to reproduce on Linux with a system ICU 4.6, but could to reproduce it when having built with the LibO internal ICU 4.2 and TZ=America/Sao_Paulo, which would explain why it occurs on Windows as the internal ICU is used there. Hopefully an upgrade to a recent ICU would solve this.
Comment 9 Kohei Yoshida 2013-01-28 19:06:05 UTC
Bug 59850 may be another manifestation of this.
Comment 10 Eike Rathke 2013-03-25 19:56:58 UTC
Timezone offset is -10800000 milliseconds (-3h), there was a historical transition from -11188000 milliseconds (-3:06:28) causing a rounding error.
Comment 11 Eike Rathke 2013-03-25 20:09:06 UTC
*** Bug 52619 has been marked as a duplicate of this bug. ***
Comment 12 Commit Notification 2013-03-25 20:33:35 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6013fe19a40dd16ce435a2428f7405b51930689e

resolved fdo#44286 some historical dates were decremented



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2013-03-26 09:00:50 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6f9b1eb8611ad706725388b15038a6673143fe34&h=libreoffice-4-0

resolved fdo#44286 some historical dates were decremented


It will be available in LibreOffice 4.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2013-03-26 09:32:57 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-0-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7d7c4aa9f07e309e9185bab77a197b3dbe1f2dd1&h=libreoffice-4-0-2

resolved fdo#44286 some historical dates were decremented


It will be available already in LibreOffice 4.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2013-03-26 09:45:59 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9dfdb7955c1f5781340dc688cc0229dea9cb4c2d&h=libreoffice-3-6

resolved fdo#44286 some historical dates were decremented


It will be available in LibreOffice 3.6.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Eike Rathke 2013-03-26 12:41:40 UTC
*** Bug 44367 has been marked as a duplicate of this bug. ***
Comment 17 Commit Notification 2013-03-28 16:31:37 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=947a54caa1bf830b986775c18d77a98482b12db4&h=libreoffice-3-6-6

resolved fdo#44286 some historical dates were decremented


It will be available already in LibreOffice 3.6.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 Winfried Donkers 2013-04-16 05:57:19 UTC
*** Bug 46047 has been marked as a duplicate of this bug. ***