cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2015
Views
2
Helpful
4
Replies

UCCX convert string to time

Ben Haverstock
Level 1
Level 1

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!

1 Accepted Solution

Accepted Solutions

geoff
Level 10
Level 10

This is fairly standard Java programming using the Calendar class. You can do this in the Expression Editor.

Regards,

Geoff

View solution in original post

4 Replies 4

geoff
Level 10
Level 10

This is fairly standard Java programming using the Calendar class. You can do this in the Expression Editor.

Regards,

Geoff

yiosepvaldes
Level 1
Level 1

@Ben Haverstock , @geoff 

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

yiosepvaldes_0-1680632877662.png

 

 

help!! support to solve and understand this inconvenience. !!!

tulibsalim
Level 1
Level 1

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.

 

yiosepvaldes
Level 1
Level 1

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]