Description: Every pre 1582-10-15 date inserted in Calc is a Julian date. Calculations on dates such as subtraction of any number of days from any date work correctly with respect on enactment of Gregorian calendar in the night from 4th to 15th of October 1582. The DAY() / TAG() function however takes the date value (integer) of any date and recalculates the Gregorian day of month based on its own algorithm ignoring the Julian cut-over. Remember: 1582-10-4 (jul) is followed by 1582-10-15 (greg). As a result =DAY(<field>) with <field> having 1582-10-4 entered shows 14 instead of 4 e.g.. Steps to Reproduce: 1.Have 1582-10-15 in field a1 and 1499-10-04 in field a3. 2.Have =A1-1 in field a2. 3.Have =DAY(A1) in field b1, =DAY(A2) in field b2 and =DAY(A3) in field b3. Actual Results: The correct Julian date 1582-10-04 is shown in field a2 just as 1499-10-04 (jul) in field a3 as expected, but field b2 shows 14 and field b3 shows 13. Expected Results: Fields b2 and b3 should show 4. Reproducible: Always User Profile Reset: No Additional Info: work around: transform to text, parse and retransform to number. happens in 24.8.1.2 (installed German -> TAG() function) and LibreOffice-still.basic-x86_64.AppImage as of 2024-12-04 and probably in all previous versions. See bug 144699 discussion as well. We need consistent usage of date formatting and calculation. Historians use Julian dates for all time prior to cut over date. All documents containing date values written in Occident between 1000 and 1500 use Julian calendar. Usage of proleptic Gregorian dates needs agreement, was agreed in astronomy but now even in NASA documents I found Julian dates without special declaration.
Created attachment 197941 [details] file showing bug