Calculate Time Duration

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
mentorshala
Posts: 1
Joined: February 14th, 2013, 3:21 am

Calculate Time Duration

Post 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)
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Calculate Time Duration

Post 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).
Post Reply