Bug 144692 - YEAR() / MONTH() / DAY() give results inconsistent with entered/displayed dates
Summary: YEAR() / MONTH() / DAY() give results inconsistent with entered/displayed dates
Status: RESOLVED DUPLICATE of bug 122158
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2021-09-24 06:13 UTC by Mike Kaganski
Modified: 2023-10-15 14:49 UTC (History)
4 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 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 ***