Calculate total time

0
hello all I’m making a attendance system in which there is check in check out format. When I click on Check In button current time is recorded, and when I Check Out also time is recorded. Now I want see the the total time spent that is calculate total time b/w check in and check out. I tried to apply sone conditions and calculations but it is not showing anything. please help  can anyone tell me how to show total time? I thought that first I’ll check total hour spent and place it in one attribute and then I’ll check total minutes  Then I’ll merge both the attributes and show it in single attribute. for hours the formula is : round(minutesBetween($EntriesList/Time,$EntriesList/EndTime):60)   for minutes : round((minutesBetween($EntriesList/Time,$EntriesList/EndTime):60) - $EntriesList/Hours) * 60   Please help me to find out the solution  
asked
2 answers
0

Seems like you already have the hours and the minutes. Is that right? If so, what is the question?

If you want to create a string out of it, you could use something like toString($yourHours) + ‘:’ + toString($yourMinutes).

This will create a String like 5:45

answered
0

Hi Dev, happy to help!

 

you could try calculating the totaltime in a sub microflow. This microflow is triggered immediately after the endtime is set. That is, from that moment you know the start- and endtime thus the total time can be calculated. To actually calculate the time between start- and endtime, you can use the ‘minutesbetween’ function (see https://docs.mendix.com/refguide/between-date-function-calls/).

 

I would suggest creating a new attribute called ‘totaltime’. And set the totaltime attribute to the calculated totaltime in the mentioned sub microflow.

 

Good luck and go make it!

answered