Time calculations way off

I am having great trouble doing simple calculations on time. I have 2 pages (one that collects a start time, and one that collects a stop time) I am using the date/time pickers. On my stop time workflow the button on that page is updating the duration in my app data and the value is just way off. The data types for my date/time pickers is date/time, and the duration data type is a number


image

can someone please help me with this. I did read on another post that someone had a problem getting it to the nearest quarter hour as it was rounding to tenths. But I cannot even get remotely close to that output. Thank you!

I could be wrong here….

But I think order of operations is causing the bug.

It divides it by 60 first.

Then subtracts. So you get a negative number.

You might benefit from turning on the expression parentheses feature to see order of operations as others have said. Its in the settings → versions tab

Thank you for suggesting the expression parentheses. I did not know that was an option. It is no longer a negative number, but is however the same number (or close to) just positive.


You’ve swapped the times now resulting in the same number.

Time out - time in

I have tried so many configurations for this as well as chat gpt’d it to death. Still working on it. I will say any time i do out-in it results in a negative number but for some reason when i do in-out its the same number but positive


image

Ok, I got it working using toolbox plug in. I will post the config so this question is solved for anyone else that runs across this.