[Libreoffice-bugs] [Bug 127170] The German documentation for time formats does not explain formatting differences of durations and wall clock time.

2019-09-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=127170

--- Comment #4 from Albrecht Müller  ---
(In reply to Eike Rathke from comment #3)
> 
> This is a bit nasty as using both the [MM] and the M codes in one format
> seems to trick out the type detection, i.e. after defining it the format at
> ...

I don't really care if this behaviour is a bug or not as this is a bug report
against the documentation and not against a particular behaviour of Calc. The
key problem here is that the help function does not specify how to deal with
ambiguous format strings: Should Calc consider these strings as illegal and
treat them as an error?  Or should it use some default interpretation? How to
deal with a situation where you want minutes values at position where Calc
would interpret it as month value? What are the exact rules to resolve the
ambiguities?

I stumbled over this problem when I found your comment
https://bugs.documentfoundation.org/show_bug.cgi?id=125099#c8 and tried to find
out the difference between "[HH]" and "HH" in the context of duration and wall
clock time. The help information
https://help.libreoffice.org/6.3/en-US/text/shared/01/05020301.html?DbPAR=SHARED#hd_id3155870
states that "HH" are between 00 and 23 while "[HH]" may deliver values above
23. It says nothing about durations or wall clock time, and nothing about
possibly different rounding behaviour. I think this is a defect in the
documentation - users cannot know the kind of difference you mention in your
comment.

Date/time calculations are tricky. A special problem is that these calculations
normally use integral quantities of time units and therefore exact calculations
are possible. Calc represents date/time values as float numbers. One day
corresponds to the value of one. Hours, minutes and seconds correspond to
values less than one. In general, points in time that correspond to a
combination of integral numbers of hours, minutes and seconds have no exact
representation as floating point values. Therefore date/time calculations
usually contain round-off errors. Nevertheless all spreadsheet programs I used
so far - including LibreOffice up to version 6.0.4.2 - delivered exact values
when I did some simple date/time calculations. There is a defect in the help
function as it does not specify how Calc is expected to handle date/time
calculations, i.e. the behaviour of date/time calculations is undefined. A
nasty consequence of this fact is a recent change the date/time calculation
algorithm. This algorithm used to deliver a difference of one minute if you
subtracted two timestamps that were one minute apart. The new algorithm returns
essentially a random value which is 0 or 1 minute with about 50% probability
each (see bug 127334) which breaks all legacy spreadsheets that contain this
kind of calculations. As the user documentation does not specify a correct
behaviour the behaviour of the new algorithm can be classified as "NOTABUG".

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 127170] The German documentation for time formats does not explain formatting differences of durations and wall clock time.

2019-09-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=127170

Eike Rathke  changed:

   What|Removed |Added

 CC||er...@redhat.com

--- Comment #3 from Eike Rathke  ---
(In reply to Albrecht Müller from comment #0)
> I observed some quite strange
> features of the time formatting mechanism, e.g. the time 23:57:00 gets
> formatted to “1437” using the format string “[MM]” but to “Minutes: [57]
> Month: 12” ( Version 6.0.4.2 (x64) on Windows) or to “Minutes: [12] Month:
> 12” (Version 6.2.6.2 Ubuntu) by the format string “"Minutes: "[MM]" Month:
> "M”. What is the correct interpretation of the format string parts “[MM]” or
> “MM”? How does it depend on the context?

This is a bit nasty as using both the [MM] and the M codes in one format seems
to trick out the type detection, i.e. after defining it the format at the end
is classified as Date format (see category where it's then assigned to). Now
datetime formats do not know anything about duration hence the first MM is
taken as a code for minute of time and the second M as a code for month, where
the wall clock minute value is 57. Note that also the brackets around [MM] are
displayed literally because in a datetime format they don't have a special
meaning. Then as a consequence when saving the document the format is saved as


  Minutes: [
  
  ] Month: 
  


which when loaded again results in the format code string

  "Minutes: ["MM"] Month: "M

but then both the MM and the M denote a month keyword because there isn't an
unquoted [MM]. This appears to be a bug (because in the file format there's the
number:minutes element) but I think it's not easily solvable due to the
ambiguity of MM.

I doubt there's a difference between Linux and Windows, but you simply tried to
load the saved document on the other platform, where it then behaves different
as explained.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 127170] The German documentation for time formats does not explain formatting differences of durations and wall clock time.

2019-09-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=127170

Xisco Faulí  changed:

   What|Removed |Added

 CC||olivier.hallot@libreoffice.
   ||org,
   ||xiscofa...@libreoffice.org
  Component|Calc|Documentation

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 127170] The German documentation for time formats does not explain formatting differences of durations and wall clock time.

2019-09-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=127170

--- Comment #2 from Albrecht Müller  ---
The documentation problem affects also the time functions (see following links)
as their documenation contains no hints at the pecularities of date and time
calculations (e.g. rounding behaviour, handling of inexact representation of
time values, handling of leap seconds https://en.wikipedia.org/wiki/Leap_second
etc.) either.

https://help.libreoffice.org/6.3/de/text/scalc/01/func_year.html?=CALC=WIN
https://help.libreoffice.org/6.3/de/text/scalc/01/func_month.html?=CALC=WIN
https://help.libreoffice.org/6.3/de/text/scalc/01/func_day.html?=CALC=WIN
https://help.libreoffice.org/6.3/de/text/scalc/01/func_hour.html?=CALC=WIN
https://help.libreoffice.org/6.3/de/text/scalc/01/func_minute.html?=CALC=WIN
https://help.libreoffice.org/6.3/de/text/scalc/01/func_second.html?=CALC=WIN

The problem seems to be inherited from the English version:
https://help.libreoffice.org/6.3/en-US/text/scalc/01/func_year.html?=CALC=WIN
https://help.libreoffice.org/6.3/en-US/text/scalc/01/func_month.html?=CALC=WIN
https://help.libreoffice.org/6.3/en-US/text/scalc/01/func_day.html?=CALC=WIN
https://help.libreoffice.org/6.3/en-US/text/scalc/01/func_hour.html?=CALC=WIN
https://help.libreoffice.org/6.3/en-US/text/scalc/01/func_minute.html?=CALC=WIN
https://help.libreoffice.org/6.3/en-US/text/scalc/01/func_second.html?=CALC=WIN

Without a clear specification there is no "expected behaviour" of date/time
calculations and results may vary considerably between different versions of
Calc.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 127170] The German documentation for time formats does not explain formatting differences of durations and wall clock time.

2019-09-04 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=127170

Albrecht Müller  changed:

   What|Removed |Added

   See Also||https://bugs.documentfounda
   ||tion.org/show_bug.cgi?id=12
   ||7334

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 127170] The German documentation for time formats does not explain formatting differences of durations and wall clock time.

2019-08-26 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=127170

Albrecht Müller  changed:

   What|Removed |Added

   See Also||https://bugs.documentfounda
   ||tion.org/show_bug.cgi?id=12
   ||5099

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 127170] The German documentation for time formats does not explain formatting differences of durations and wall clock time.

2019-08-26 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=127170

Albrecht Müller  changed:

   What|Removed |Added

 CC||albrecht.muel...@astrail.de

--- Comment #1 from Albrecht Müller  ---
Created attachment 153670
  --> https://bugs.documentfoundation.org/attachment.cgi?id=153670=edit
The file contains a few examples of time calculation and formatting problems

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs