cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1372
Views
15
Helpful
1
Replies

calculate time in uccx script

Mikhail Kalita
Level 1
Level 1

Good day! How can I calculate exact time in seconds between "Accept" (-Triggering Contact-) and "Terminate" (-Triggering Contact-)? 

1 Reply 1

Aaron Harrison
VIP Alumni
VIP Alumni

Hi

Just after your accept step, use a set step to set a 'Date' var named StartTime to D[now]

At 'terminate', use a set step to set a 'Date' var named EndTime to D[now]

then use another Set step to calculate the difference in secs, assign it to an int var named 'CallLenght'

(int)((EndTime.getTime() - StartTime.getTime())/1000);

Regards

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!