Issues with date_interval / date subtraction

Time interval and taking difference between times does not give correct result. I need to measure the interval between two dates - both stored as fields in the data base, i.e. date_selected and date_unselected.

I have tried two versions, i.e. using data type date_interval and formatting into seconds / minutes in the frontend, or using data_type number and formatting to seconds / minutes in the back-end while storing.

You can see the results in the attached screenshot. Even though the difference should be 2-3 minutes, I am getting extremely large absolute results. When doing later date - earlier date I get negative results (second line in screenshot), whereas when I do earlier date - later date I get positive results (first line in screenshot). But either direction there seems to be an offset of a few thousand days to what the interval should be.

Please let me know what I am doing wrong or fix the issue as it blocks one of the key features in my app. I have already reported this as a bug, but maybe somebody in the forum knows the issue and it’s something I am doing wrong?

Alright, I found the solution!

Apparently it is not possible to write current date and time into a field and in the same step also subtract it from another field (in my case creation date) as it then subtracts from an empty field and hence gives you a huge negative number.

Solution is to simply put the calculation into two consecutive workflow steps, i.e.

Step 1:

Step 2: