For example
The clock (time format) 10:00:00 is in Cell B1
I want to add 23 minutes and 10 seconds and show the result in C1 (for example)
The result in C1 will be 10:23:10
How to do that?
[Solved] Add minutes to a timevalue
[Solved] Add minutes to a timevalue
Last edited by MrProgrammer on Wed Jan 25, 2023 10:07 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OOo 4.1.X on Windows XP, Win7, 10
-
- Volunteer
- Posts: 263
- Joined: Tue Apr 18, 2017 8:23 am
- Location: Germany
Re: Add minutes to a timevalue
Be advised that Calc counts times in days. So the easiest way is to format cells in time format like [HH]:MM:SS.
Counting with time spaces (periods) is usually not that easy.
Find more information here:
https://help.libreoffice.org/latest/en- ... alues.html
Search for time or calculating with time.
LibreOffice current versions 24.x/25.x and OpenOffice 4.1.15
on LinuxMint 20 - 21 Mate, W10-64 pro
on LinuxMint 20 - 21 Mate, W10-64 pro
Re: Add minutes to a timevalue
Please prefer to attach actual example files (.odt in this case) over images/sreenshots if not the issue is expressly concerning the view.
This problem may look trivial, but actually is due to a fundamental shortcoming of spreadsheets: They don't offer a standardized way to enter durations (differences in time).
In addition there is a very bad practice to find everywhere: The colon-separated formats specifically standardized for TimeOfDay values are misused to communicate durations (or time spans).
Closely related to this second problem we find the extremely bad habit to try to express a duration of (e.g.) "23 min 10 s" as "23:10". This is definitely inacceptable because the relavant specification of colon-separated formats (by proper authority: ISO) expressly states that shortened formats always must start with the hours part.
Thus you are (practically) forced...
1. to enter durations in the TOD format actually deprecated for the purpose.
2. to NOT omit the starting 00: (or 0:) for the hours.
In addition you may want to add a delay which shifts the resulting TOD to the next day , and there is no accepted format for the display of the result in such a case. To get that correctly, you would
need to enter and display the starting point in time as a DateTimeStamp.
Note: If you want to use the traditional non-decimal subdivions of a day into 24 hours, of an hour into 60 minutes, and of a minute into 60 seconds (going back to the earliest days of calendaric astronmomy) you are forced to stick to the underlying "unit" day (d) in spreadsheets. This ignoring the fact that engineering and science wouldn't do so, because the calendaric day isn't of constant length (on the level of precision we currently assume granted).
See attached example:
This problem may look trivial, but actually is due to a fundamental shortcoming of spreadsheets: They don't offer a standardized way to enter durations (differences in time).
In addition there is a very bad practice to find everywhere: The colon-separated formats specifically standardized for TimeOfDay values are misused to communicate durations (or time spans).
Closely related to this second problem we find the extremely bad habit to try to express a duration of (e.g.) "23 min 10 s" as "23:10". This is definitely inacceptable because the relavant specification of colon-separated formats (by proper authority: ISO) expressly states that shortened formats always must start with the hours part.
Thus you are (practically) forced...
1. to enter durations in the TOD format actually deprecated for the purpose.
2. to NOT omit the starting 00: (or 0:) for the hours.
In addition you may want to add a delay which shifts the resulting TOD to the next day , and there is no accepted format for the display of the result in such a case. To get that correctly, you would
need to enter and display the starting point in time as a DateTimeStamp.
Note: If you want to use the traditional non-decimal subdivions of a day into 24 hours, of an hour into 60 minutes, and of a minute into 60 seconds (going back to the earliest days of calendaric astronmomy) you are forced to stick to the underlying "unit" day (d) in spreadsheets. This ignoring the fact that engineering and science wouldn't do so, because the calendaric day isn't of constant length (on the level of precision we currently assume granted).
See attached example:
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München