Bug 51480 - FORMATTING: Date / Time computing and formatting
Summary: FORMATTING: Date / Time computing and formatting
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-27 09:42 UTC by Studio Firpo
Modified: 2012-12-18 14:59 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
an example, where one can input working days and parameters (pale yellow background), obtaining total working time (duration) in hours and minutes (pale green background) (10.70 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-06-27 09:42 UTC, Studio Firpo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Studio Firpo 2012-06-27 09:42:54 UTC
Created attachment 63525 [details]
an example, where one can input working days and parameters (pale yellow background), obtaining total working time (duration) in hours and minutes (pale green background)

Problem description: 

Computing of duration greater than 24 hours, working correctly with previous versions, fails if duration is greater than 24 hours (format with square brackets).

Steps to reproduce:
1. Input one timestamp (beginning of time period)
2. Input one timestamp (end of time period)
3. Calculate duration (2. minus 1.)
4. Format duration with square brackets to avoid reconduction within 24 hours range

Current behavior:

duration will be calculated and displayed within 24 hours range

Expected behavior:

duration will be calculated and displayed with number of hours, even if beyond 24 hours range
Platform (if different from the browser): Fedora 17 x86_64
              
Browser: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Comment 1 leo.moons 2012-12-16 22:24:50 UTC
This is a regression, as display is not correct when TIME function is used in conjunction with square brackets. With square brackets, numbers of hours must be displayed even when number of hours exceeds 24. (working under Windows 7 en LibO 4.0.0)

Display was correct for this function in LibO 3.4.3 (working under Windows XP)

Leo
Comment 2 Michel Rudelle 2012-12-18 14:59:51 UTC
Complying with ODF standard:
Open Document Format for Office Applications (OpenDocument) Version 1.2
Part 2: Recalculated Formula (OpenFormula)Format
OASIS Standard 29 September 2011

TIME function is defined § 6.10.17 page 81:
"Returns: Time"
"Semantics: Returns the fraction of the day consumed by the given time"

and the type "Time" is defined § 4.3.2 page 33:
"Time is a subtype of Number."
"Time is represented as a fraction of a day"

Then, the result must be always < 1, and this is what you have in your example. There is not a bug here.

In your example, you may obtain what you are expecting in a very simple way:
change the formula in cell B6 with: =B1*B3