Good Afternoon Everyone.
I'm trying to figure a issue with the time difference formula. So our use case is we've built a time clock application where our employees walk in, enter their pin # and press a clock in button which create a time sheet record with the clock in time. Same concept for clocking out except it updates that same record with a clock out entry in the clock out field. Our issue is the way espo is rounding these times. For example
Clock in Time:
Clock Out Time:
It generates 10 for total hours worked using the below formula. However it should technically be 10.02.
$totalWorkedHours=datetime\diff(clockOutTime, clockInTime, 'minutes');
$roundedWorkHours=$totalWorkedHours/60;
totalWorkedHours=number\round($roundedWorkHours, 2);
Does anyone know of a solution to this issue?
I'm trying to figure a issue with the time difference formula. So our use case is we've built a time clock application where our employees walk in, enter their pin # and press a clock in button which create a time sheet record with the clock in time. Same concept for clocking out except it updates that same record with a clock out entry in the clock out field. Our issue is the way espo is rounding these times. For example
Clock in Time:
12/02/2021 06:21 AM |
12/02/2021 04:22 PM |
It generates 10 for total hours worked using the below formula. However it should technically be 10.02.
$totalWorkedHours=datetime\diff(clockOutTime, clockInTime, 'minutes');
$roundedWorkHours=$totalWorkedHours/60;
totalWorkedHours=number\round($roundedWorkHours, 2);
Does anyone know of a solution to this issue?
Comment