Page 1 of 1

Calculate Time Duration

Posted: February 14th, 2013, 4:18 am
by mentorshala
If Possible to calculate automatically Length of interview in minutes in question M-15.


M-13. Write clock (24-hour clock) when the interviews
began: ____: ____
(Fill in all positions)

M-14. Write clock (24-hour clock) when the interviews
is performed: ____: ____
(Fill in all positions)

M-15. Length of interview in minutes: ____
(When interviews lasting more than 99 minutes
marked as 99)

Re: Calculate Time Duration

Posted: February 14th, 2013, 2:40 pm
by Gregory Martin
One way you could do this is to do all of the calculations in minutes. For example, if your variables are M13_H (hour) and M13_M (minute), you could get the difference in minutes with the following code:
M15 = low(99, ( M14_H * 60 + M14_M ) - ( M13_H * 60 + M13_M ) );
That assumes that the interview was conducted on the same day (so that M14_H will always be greater than or equal to M13_H).