I have two different times in different screens. Both are stored with TinyDB. And on another screen, these two times should be added together. I've tried everything, e.g. trying to convert it to milliseconds, with pattern HH:mm etc. but with each the same message comes up "The operation (GetMillis) cannot accept the arguments: , [00:11]". How can I make it so I can add them up? Of course, the thing about GetMillis changes depending on what I'm trying to do, not because someone asks why GetMillis is always there.
Thanks for the answers.
Be aware that the milliseconds used in Clock blocks refer to milliseconds since 1970, not durations.
Does that answer your question?
Once again. I have two clocks where a timer is counting up, for that I use these blocks, i.e. HourAndMinute. I want to add these two times together so that I have a result of both times. With every attempt, however, the error The operation ... cannot accept the arguments: , [00:11] comes up. So I wanted to have a solution how to add these two times together. Please don't tell me to do this in one clock, it has to be in separate clocks and added at the end.
Thank you and have a nice day.
Show us an example of what you want to achieve exactly.
And read this:
You have options as to how you store time values.
- Display-friendly formats, ready for assignment to labels, or
- calculation-friendly arithmetic values, ready for math.
You can convert from one format to another.
This should be fairly trivial if both counters are on one screen:
(I have not formatted the label outputs to a time format)
The fun begins when the counters are on different screens, given that when a user is on Screen1 the counter on Screen2 is not running, and will need to be stopped and started when switching screens to avoid a crash. The same applies in reverse. This will/should not prevent the adding of the two counters though, a bit more work needed with counter 2 clock blocks.
Bear in mind that the AI2 clock timer can "drift", so if the count timers are mission critical then you may need to check back with system time, or use an extension that provides a more accurate count.
First of all thank you for your attention. I think you didn't understand my problem. So again: On the first screen there is a TimePicker where you can set the time. This TimePicker is there to calculate the duration between the entered time and the current time. There is a label where you can see the duration. My problem before was that it was displayed in milliseconds. For this I downloaded this extension and the duration between the entered time and the current time is now displayed in hour and minute format in a label. The second screen is exactly the same. These two labels are stored with TinyDB and I want to add them together on a third screen. But I don't know how to add them together. I've tried everything, but each one gives the same error. I also did a lot of research. Can someone help?
It really doesn't matter how you "start" your count or what you display, your counter will still be counting up in whatever interval you set.
You have the clock component, you can set the start "time" and stop "time" to variables if you need to relate the elapsed time (count) to real time.
Did you take in the issue that timers need to be stopped before switching screens, and therefor started when screen is opened ?
Please download and post each of those event block(s)/procedures here ...
You don't need an extension to do time conversion.
The Clock component and the math blocks have all you need.
Keep milliseconds in TinyDB and add milliseconds to milliseconds using math blocks.
Don't expect math blocks to understand ":" or empty text.
Here is a sample value procedure to make a displayable HH:MM:SS from a milliseconds count:
P.S. These blocks can be dragged directly into your Blocks Editor workspace.
See A way to group projects by theme - #10 by ABG
for a demo.
P.S. I left out NN: