https://bugs.documentfoundation.org/show_bug.cgi?id=166268

            Bug ID: 166268
           Summary: Problem with date functions in LO Calc 25.2 on Mac -
                    apparent issue with base date
           Product: LibreOffice
           Version: 25.2.1.2 release
          Hardware: x86-64 (AMD64)
                OS: macOS (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Description:
Topic: EDITING / FILESAVE (?)
In some cases / some files, the LO Calc date functions YEAR, MONTH and DAY
behave erratically with respect to the base date: when the setting is
1904-01-01, they mostly work correctly, but sometimes assume the default
1899-12-31 setting.
(The dates are always displayed correctly, according to the base date setting.)

Steps to Reproduce:
Not always reproducible - some files OK, some obviously wrong.
See attachments: affected file & screenshots of the steps below.
1) Date preference = 1904-01-01.
2) Year-Month-Day calculations in file are false, with a 4-year-1-day error.
3) Upon entry of another value, the corresponding calculated year-month-day is
OK.
4) Force recalculate of whole file.
5) After recalculation, the previously correct entered line is again false.

Actual Results:
When calculating the whole file, the date functions obviously sometimes apply
the 1899-12-31 system, although the preference is set for 1904-01-01.
Strangely, however, they work correctly when entering data!
Also, the displayed dates are always correct in the 1904 system.

Expected Results:
The date functions (YEAR, MONTH, DAY) should reliably apply the selected base
date upon recalculating the file, as they do when entering data (step 3),
instead of behaving somewhat erratically.


Reproducible: Sometimes


User Profile Reset: Yes

Additional Info:
- See affected attached file ""LO Calc date base problem.ods" + screenshots.
- The problem is confirmed in safe mode - this is not a user profile issue.
- Not all files are affected.
- The first time I saw the problem was with 25.2.1.2. Same with 25.2.2.2.
- There is a workaround: setting the base date preference to 1899-12-31.
6) Strangely, recopying the problematic data & formulae elsewhere (copy-paste)
in the worksheet generates a working data set - now, upon recalculating,
columns B-D still behave badly, but the copied data & formulae in column I-L
work properly!
7-8) Upon setting the base date to 1899-12-31, all works fine.
9-10) Upon returning the base date to 1904-01-01, again bad (A-D) / good (I-L).
Regression:
- The problem lies with the base date, it is not just some "wrong calculation".
- The facts that a) some cells are affected and some not in the same file, b)
that calculation is always correct upon entry, but not upon recalculation of
the spreadsheet, and c) there sometimes is an obvious conflict between the
displayed date and the year-month-day breakdown using the date functions, point
to some sort of local storage issue / erratic behaviour in the date functions
rather than a global problem. An analysis of the file could be helpful in this
regard.

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

Reply via email to