<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - DAY(), MONTH() and YEAR() functions don't handle Gregorian cut-over"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=122158">122158</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>DAY(), MONTH() and YEAR() functions don't handle Gregorian cut-over
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Inherited From OOo
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Calc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>erack@redhat.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In A1 enter date 1582-10-16
In A2 enter date 1582-10-15
Select A1:A2 and pull down a few cells, resulting dates are 1582-10-04,
1582-10-03, ..., correct due to the Gregorian calendar cut-over.
In B2 enter =DAY(A2) => 15
In B3 enter =DAY(A2) => 14  (wrong)
Similar for a date of 1582-09-30 the MONTH() function calculates 10 instead of
9.
For a date of 1581-12-31 the YEAR() function calculates 1582 instead of 1581.

The DAY(), MONTH() and YEAR() functions do not take the 10 days gap at the
Gregorian calendar's cut-over date into account. The date serial numbers and
number formatter display values are correct, hence subtracting 1582-10-04 from
1582-10-15 (i.e. =A2-A3) is indeed one day, and adding one day to 1582-10-04
(i.e. =A3+1) results in 1582-10-15.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>