[Libreoffice-bugs] [Bug 135505] Calc: Maths with date off by one day in the afternoon

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Aug 6 17:17:02 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=135505

Mike Kaganski <mikekaganski at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #1 from Mike Kaganski <mikekaganski at hotmail.com> ---
(In reply to simon from comment #0)
> 1. Cell G1:   =NOW()  Assume it is 06/08/20

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200806/d035b62a/attachment.htm>


More information about the Libreoffice-bugs mailing list