How to get current date time in the script? (SOLUTION)

I found two ways to get current date and time in the script.
If we sum "Agent Call Start Time" and "Agent Call Duration" or "Customer Call Start Time" and "Customer Call Duration", then we will current time.

Create dynamic string variable and paste one of the below functions into "Dynamic Value" field.

Using Agent

formatDate(dateToMilliseconds({{Scripter.Agent Call Start Time}}) +durationToMilliseconds({{Scripter.Agent Call Duration}}))

Output: 06/30/2023 1:27:10 pm (-04:00)

Using Customer

formatDate(dateToMilliseconds({{Scripter.Customer Call Start Time}}) +durationToMilliseconds({{Scripter.Customer Call Duration}}))

Output: 06/30/2023 1:27:10 pm (-04:00)

If we want to display only MM/DD/YYYY, then add date format using Unicode standard.

formatDate(dateToMilliseconds({{Scripter.Customer Call Start Time}}) +durationToMilliseconds({{Scripter.Customer Call Duration}}), "MM-dd-yyyy")

Output: 06/30/2023

2 Likes

Hi Artur,

Thanks for posting and sharing.

  • John
1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.