incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 120390] New: Function MONTH gives wrong result for many dates prior to October 1582
Date Fri, 27 Jul 2012 13:53:54 GMT

          Priority: P3
            Bug ID: 120390
           Summary: Function MONTH gives wrong result for many dates prior
                    to October 1582
          Severity: normal
        Issue Type: DEFECT
    Classification: Application
                OS: All
          Hardware: All
            Status: UNCONFIRMED
           Version: AOO 3.4.0
         Component: ui
           Product: spreadsheet

Created attachment 78757
Calc spreadsheet showing affected dates

Ok, this is definitely obscure, but for the record ...

The MONTH function in Calc returns incorrect results for many dates prior to
Oct 1582.

For example,

Enter this date:
A1: 1582-01-22

Check the month for the date:
B1: =MONTH(A1)

Result: 2 (should be 1)

Change A1 to 1582-01-21

Now MONTH in B1 returns the correct result, 1

The same function, in the number formatting code, gives the correct result (for
all dates that I've checked):
C1: =A1
Format > Cells > Numbers > Format code: M (month number)

Result: 1 (correct)

This provides a simple workaround for finding the correct month:

The attached sheet shows which dates are affected for any given year; only
dates prior to the calendar change (October 1582 in Calc) are affected. It
seems that perhaps the MONTH code does not account properly for the ten days
skipped in the Gregorian reform.

Forum thread where the problem was first reported:

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

View raw message