<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:mikekaganski@hotmail.com" title="Mike Kaganski <mikekaganski@hotmail.com>"> <span class="fn">Mike Kaganski</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Calc: Maths with date off by one day in the afternoon"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=135505">bug 135505</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>UNCONFIRMED
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>NOTABUG
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Calc: Maths with date off by one day in the afternoon"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=135505#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Calc: Maths with date off by one day in the afternoon"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=135505">bug 135505</a>
              from <span class="vcard"><a class="email" href="mailto:mikekaganski@hotmail.com" title="Mike Kaganski <mikekaganski@hotmail.com>"> <span class="fn">Mike Kaganski</span></a>
</span></b>
        <pre>(In reply to simon from <a href="show_bug.cgi?id=135505#c0">comment #0</a>)
<span class="quote">> 1. Cell G1:   =NOW()  Assume it is 06/08/20</span >

No, it is not "06/08/20". NOW [1] returns not a day, it returns a datetime
value - i.e., day *and time of the day*, the latter as a fraction of a day. So
e.g. for now, =NOW gives me 2020-08-06 20:10:48, which is 44049.8408352431
internally; and the ".8408352431" is "afternoon" (i.e., 20:10:48).

If you format your cell to show you only whole part of the datetime value
(i.e., only date), you do not change your calculations, which still see the
actual value stored in the cell, not the result of formatting.

Also it looks like you have formatted N307 to not show you fractional part, so
it rounds the result of the subtraction, and ".8408352431" is shown as "1",
while "0.23456" is shown as "0".

You likely need to use TODAY [2] instead of NOW.

Closing NOTABUG.

[1] <a href="https://help.libreoffice.org/6.4/en-US/text/scalc/01/func_now.html">https://help.libreoffice.org/6.4/en-US/text/scalc/01/func_now.html</a>
[2] <a href="https://help.libreoffice.org/6.4/en-US/text/scalc/01/func_today.html">https://help.libreoffice.org/6.4/en-US/text/scalc/01/func_today.html</a></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>