<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 - Formatting [HH]:mm sometimes looses a second"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=124303">124303</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Formatting [HH]:mm sometimes looses a second
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.2.0.3 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </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>martin@atke-bentsen.dk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
Using the [HH] formatting can result in some inapropriate floorings of the
underlying double value of a datetime, loosing a second, that can propagate up
to loosing a minute or an hour. Quite problematic when using LibreCalc to
calculate saleries of hourly paid employees. Using HH (without the brackets),
there is proper rounding to avoid this precision problem of floats to propagate
up to loosing a second. See steps to reproduce.

Steps to Reproduce:
1. In cell A1 write 17:   (will show 17:00:00)
2. In cell B1 write 21:   (will show 21:00:00)
3. In cell C1 write =B1-A1   (will show 04:00:00   correct)
4. Change format of C1 to: [HH]:mm  (will show 03:59   wrong)
5. Change format of C1 to: [HH]:MM:SS.000000000000000 (will show
03:59:59.999999999996362   wrong)
6. Change format of C1 to: HH:MM:SS.000000000000000 (will show
04:00:00.000000000000000   correct, but wont work as [HH] when above 24 hours)


Actual Results:
03:59

Expected Results:
04:00


Reproducible: Always


User Profile Reset: Yes



Additional Info:
I think this problem started around v4, and is still a problem i v6. Was not a
problem in some old v3.

A workaround i have been using is to add a second, that is then rounded of when
only showing minutes. Like in reproduce example, in C1 write: 
=B1-A1+"00:00:01"   
and format [HH]:mm</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>