09-13-2011 12:24 PM - edited 03-14-2019 08:32 AM
I am trying to have a prompt that will accept a string value of 4 digits and then take that string and convert those digits to a time value. Assuming 24 hour time format. Then take that time and compare to the current time to decide a Time of Day prompt. What I am trying to accomplish is to be able to remotely call in and set our call center to close at a specific time without having to edit the script. Does anyone know if this is possible to do? I have everything else completed but I just cannot figure out how to convert the prompt input to time.
Thanks!
Solved! Go to Solution.
09-13-2011 09:09 PM
This is fairly standard Java programming using the Calendar class. You can do this in the Expression Editor.
Regards,
Geoff
09-13-2011 09:09 PM
This is fairly standard Java programming using the Calendar class. You can do this in the Expression Editor.
Regards,
Geoff
04-04-2023 11:28 AM
hi,
I am having the same problem described in this conversation, but I am in a cuccx 12.5.1 su1 editor, and the step or syntax that I am trying to use to convert the data or variable content is the following:
RealTime.valueOf(StringTime) *** It does not appear available in the construction or edition of variables
The one I am using is the following:
Time.valueOf(StringTime)
but I get the following error just like someone else here
help!! support to solve and understand this inconvenience. !!!
04-05-2023 02:54 PM - edited 04-06-2023 02:59 PM
String timeStr = "14:30:00";
Date time = parseDateTime(timeStr, "HH:mm:ss");
the parseDateTime function takes two arguments: the string to parse and a format string that specifies the expected format of the string. The format string uses the same symbols as the Java SimpleDateFormat class.
In this case, the format string "HH:mm:ss" specifies that the time string should be in the format "hours:minutes:seconds", with leading zeros if necessary. The function returns a Date object representing the parsed time.
You can then use the Date object in your UCCX script to perform further calculations or comparisons as needed.
04-10-2023 08:24 AM
hi,
solution in my case:
example 1
variable:
TimeX -> i need
StringTimeX = "15:30:00"
expression
TimeX = Time.valueOf(StringTimeX)
example 2
variable:
TimeX -> i need
StringTimeX = "03:30:00 PM"
expression
TimeX = T[StringTimeX]
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide