Please REMOVE me from the Bugzilla mail list.
I have returned to Open Office 3.3 & will wait until/when 3.4 is fixed properly!

[email protected]


On 7/27/2012 9:53 AM, [email protected] wrote:
https://issues.apache.org/ooo/show_bug.cgi?id=120390

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

Created attachment 78757
   --> https://issues.apache.org/ooo/attachment.cgi?id=78757&action=edit
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:
=VALUE(TEXT(date;"M"))

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:
http://user.services.openoffice.org/en/forum/viewtopic.php?f=9&t=55329


Reply via email to