calculating time between two dateTimes

Hi all, I’m creating an app for recording working hours. the user should inserts his start time & Leaving Time, then the app should calculate the working hours.          these pictures for my microflow & the parameters. I want to ask if their anyway in Mendix to calculate the difference between two date times?.. because when I tried to use hoursBetween(dateTime()) function I got an error tells me the values of the function should be integers. but in my case how can I make the dateTime integer?  So, if there’s a solution for this issue it will be great. 
1 answers

This can be done using the hoursBetween function 


The expression would be something like this: hoursBetween($WorkingHoursRecord/StartTime, $WorkingHoursRecord/EndTime)