Calculating Time Difference between Date-Time fields in Minutes
Hi everyone,
I know that there were a lot of concerns regarding time difference calculation, especially if you want to calculate it in a number field.
I went through a lot of articles but I couldn't find a solution that I wanted, I wanted to calculate the time difference in minutes.
I was following the guide of (
Igor Vat ), but I got stuck when I wanted to calculate in minutes only, so I needed to get the days/hours difference to be converted to minutes and add that to the actual difference in minutes.
So I came up with the below:
input.TimeDif= hoursBetween(input.Start_Time,input.End_Time) * 60 + floor((((input.End_Time- input.Start_Time)) / 1000) / 60) % 60 + 1;
where TimeDif is a numbers field.
this one solved my concern, although the seconds are being rounded, but it's not an issue if your goal is to calculate the minutes.
I appreciate if you have another workaround for this topic that you may share here.
Regards,
Bashar