Bug 144692

Summary: YEAR() / MONTH() / DAY() give results inconsistent with entered/displayed dates
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: 79045_79045, andreas.heinisch, philippe, rb.henschel
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=96756
https://bugs.documentfoundation.org/show_bug.cgi?id=144678
https://bugs.documentfoundation.org/show_bug.cgi?id=144687
https://bugs.documentfoundation.org/show_bug.cgi?id=144699
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108827    

Description Mike Kaganski 2021-09-24 06:13:06 UTC
Check:

=YEAR("1581-12-22")
=MONTH("1581-12-22")
=DAY("1581-12-22")

The expected results are: 1581, 12, 22.
The actual results are: 1582, 1, 1.

The problem is the use of Julian calendar for date recognition and formatting for dates prior to 1582-10-15, but use of proleptic Gregorian for YEAR/MONTH/DAY.
Comment 1 Vollbracht 2021-09-26 12:53:48 UTC
Same in German:
Tag(10.1.1500) should be 10 but due to Iulian leap year and correct calendar switch (15.10.1582 - 1 = 4.10.1582) it results to 19.
Comment 2 Mike Kaganski 2022-07-14 20:20:57 UTC
*** Bug 149040 has been marked as a duplicate of this bug. ***
Comment 3 Regina Henschel 2023-10-15 14:49:47 UTC
Problems with dates before the Gregorian calendar start in 1582-10-15 is already tracked in bug 122158.

*** This bug has been marked as a duplicate of bug 122158 ***