Calculating elapsed time

So, I need to show the time that passed between ‘in’ and ‘out’ captured times.

To show that in a label_calc, Eduardo Aramizu came up with this calculation:

"label_calc": "Math.floor((new Date('1970-1-1 ' + model.time2) - new Date('1970-1-1 ' + model.time1))/1000/60/60).toString() + ':' + Math.round(((new Date('1970-1-1 ' + model.time2) - new Date('1970-1-1 ' + model.time1))/1000/60/60%1)*60).toLocaleString('en-US', {minimumIntegerDigits: 2})"

Which worked nicely.

Thanks again Eduardo!

(ps. how lucky are we that FileMaker just ‘does’ it?)

2 Likes

Update:
the above works on desktops but not on tablets

Format should be:
new Date(‘1970-01-01T’ + model.time2)