Bug 83414 - Other: Error calculating time
Summary: Other: Error calculating time
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.5.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-02 19:36 UTC by Bazan Marcelo
Modified: 2014-09-04 07:22 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Selfexplanatory. Read text included. (293.62 KB, image/jpeg)
2014-09-02 19:36 UTC, Bazan Marcelo
Details
Here's the file you requested. Hope it helps. (61.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-09-02 20:49 UTC, Bazan Marcelo
Details
Calc Bug.ods (61.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-09-02 21:15 UTC, Bazan Marcelo
Details
Calc Bug.ods (61.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-09-02 21:16 UTC, Bazan Marcelo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bazan Marcelo 2014-09-02 19:36:54 UTC
Created attachment 105634 [details]
Selfexplanatory. Read text included.

Problem description: 
Well, basicaly I entered a serious of values representing times (the duration of some tutorials actually) but, when I tried to sum them & get the answer in Days:hours:minutis:seconds format I get 1 day less than the correct answer. I did the same calculation in Excel & I got the right amount.
Steps to reproduce:
1. Pasted several times in a column
2. Used Autosum to get the value in normal H:m:s format.
3. Changed format to "[h]:mm:ss" to get the total amount of hours.
4. Changed format to "d:hh:mm:ss" to get days as an added value.

See attached image to compare.

Thanks.
Bazan, Marcelo.
Operating System: Windows 7
Version: 4.2.5.2 release
Comment 1 Joel Madero 2014-09-02 20:40:45 UTC
Please attach the actual document with the data so that we can open it in excel and calc to see the difference. 

Marking as NEEDINFO - once you attach the document please mark as UNCONFIRMED. Thanks!
Comment 2 Bazan Marcelo 2014-09-02 20:49:53 UTC
Created attachment 105637 [details]
Here's the file you requested. Hope it helps.
Comment 3 Bazan Marcelo 2014-09-02 21:15:24 UTC
Created attachment 105639 [details]
Calc Bug.ods

Hi Joel:

Here you are. I send you the file you requested. Hope it helps.

Bazan, Marcelo

----- Mensaje original -----
De: bugzilla-daemon@freedesktop.org
Para: bazanmarcelo@ciudad.com.ar
Enviados: Martes, 2 de Septiembre 2014 17:40:45
Asunto: [Bug 83414] Other: Error calculating time

https://bugs.freedesktop.org/show_bug.cgi?id=83414

Joel Madero <jmadero.dev@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEEDINFO
                 CC|                            |jmadero.dev@gmail.com
     Ever confirmed|0                           |1

--- Comment #1 from Joel Madero <jmadero.dev@gmail.com> ---
Please attach the actual document with the data so that we can open it in excel
and calc to see the difference. 

Marking as NEEDINFO - once you attach the document please mark as UNCONFIRMED.
Thanks!
Comment 4 Bazan Marcelo 2014-09-02 21:16:52 UTC
Created attachment 105640 [details]
Calc Bug.ods

Hi Joel:

Here you are. I send you the file you requested. Hope it helps.

Bazan, Marcelo

----- Mensaje original -----
De: bugzilla-daemon@freedesktop.org
Para: bazanmarcelo@ciudad.com.ar
Enviados: Martes, 2 de Septiembre 2014 17:40:45
Asunto: [Bug 83414] Other: Error calculating time

https://bugs.freedesktop.org/show_bug.cgi?id=83414

Joel Madero <jmadero.dev@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEEDINFO
                 CC|                            |jmadero.dev@gmail.com
     Ever confirmed|0                           |1

--- Comment #1 from Joel Madero <jmadero.dev@gmail.com> ---
Please attach the actual document with the data so that we can open it in excel
and calc to see the difference. 

Marking as NEEDINFO - once you attach the document please mark as UNCONFIRMED.
Thanks!
Comment 5 m_a_riosv 2014-09-02 22:09:53 UTC
Please Marcelo, verify if the option in Menu/Tools/LibreOffice calc/Calculate - Date is affecting your calculations.
Comment 6 Bazan Marcelo 2014-09-02 23:19:53 UTC
Hola Mario:

He chequeado las 3 opciones y con 2 de ellas me dan 18 días (la actual -12/30/1899- me da 16 días) pero el resultado correcto es 17 días!!.

Gracias.
Bazan Marcelo

Hello Mario:

I've checked the 3 options & with 2 of them give me 18 days (the actual -12/30/1899- gives me 16 days) but the correct result is 17 days!!.

Thanks.
Bazan Marcelo


----- Mensaje original -----
De: bugzilla-daemon@freedesktop.org
Para: bazanmarcelo@ciudad.com.ar
Enviados: Martes, 2 de Septiembre 2014 19:09:53
Asunto: [Bug 83414] Other: Error calculating time

https://bugs.freedesktop.org/show_bug.cgi?id=83414

m.a.riosv <mariosv@miguelangel.mobi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mariosv@miguelangel.mobi

--- Comment #5 from m.a.riosv <mariosv@miguelangel.mobi> ---
Please Marcelo, verify if the option in Menu/Tools/LibreOffice calc/Calculate -
Date is affecting your calculations.
Comment 7 Bazan Marcelo 2014-09-02 23:19:53 UTC
Hola Mario:

He chequeado las 3 opciones y con 2 de ellas me dan 18 días (la actual -12/30/1899- me da 16 días) pero el resultado correcto es 17 días!!.

Gracias.
Bazan Marcelo

Hello Mario:

I've checked the 3 options & with 2 of them give me 18 days (the actual -12/30/1899- gives me 16 days) but the correct result is 17 days!!.

Thanks.
Bazan Marcelo


----- Mensaje original -----
De: bugzilla-daemon@freedesktop.org
Para: bazanmarcelo@ciudad.com.ar
Enviados: Martes, 2 de Septiembre 2014 19:09:53
Asunto: [Bug 83414] Other: Error calculating time

https://bugs.freedesktop.org/show_bug.cgi?id=83414

m.a.riosv <mariosv@miguelangel.mobi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mariosv@miguelangel.mobi

--- Comment #5 from m.a.riosv <mariosv@miguelangel.mobi> ---
Please Marcelo, verify if the option in Menu/Tools/LibreOffice calc/Calculate -
Date is affecting your calculations.
Comment 8 penttila 2014-09-03 12:55:33 UTC
I can confirm this bug, with the following even more crazy results:

1899. 12. 30 --- 15:20:01:39
1900. 01. 01 --- 17:20:01:39
1904. 01. 01 --- 16:20:01:39

LinuxMint 17 Cinnamon
LO   4.2.4.2 Build id.: 420m0(Build:2)
Comment 9 GerardF 2014-09-03 14:47:49 UTC
This is not a bug.

Your sum result is 428:01:39 (format [HH]:MM:SS) or 17.8344791666667 formated as number.
Original default date in Calc is 0 = 1899-12-30
Your result is 17.83 days after original day 00:00.
1899-12-30 00:00:00 + 428:01:39 = 1900-01-16 20:01:39

When formatting DD:HH:MM:SS (date-time format) you get the Day which is january *16*.

The result with Excel seems correct because Excel original date is 1 = 1900-01-01
I wrote "seems correct" because Excel behaviour with this format is the same as LO Calc.

Do the same formatting with a result greater than 768:00:00 in Excel and you will see the result.
Comment 10 penttila 2014-09-04 07:22:14 UTC
Sorry but something is not OK for me!

I would like to add the following two time(!) values and get the result in such a format which also displays the number of days.

11:11:11
22:22:22
-----------
33:33:33   (should be like  01:09:33:33)

If I change the result cell format to custom  'DD:HH:MM:SS' the cell format category is automatically changed from 'time' to 'date' and the result is 31:09:33:33! This is the root of the problem, the cell category should always remain 'time' as I am working with time values and not with dates!

The 'time' cell category itself should contain this required 'day-time' format (not date-time) which is missing at the moment. (May be it could be marked different from DD:HH:MM:SS.)

Some other notes:
1) Comment #9 should not be relevant in this case as we are speaking about times and not dates!
2) Is this automatic cell category conversion feature OK? It leads to such dangerous situations!
3) I am not an expert of Calc but maybe there should be an error message/sign when the result doesn't fit in the specified HH:MM:SS format!