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

calculate time in uccx script

Mikhail Kalita
Beginner
Beginner

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

1 Reply 1

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!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers