UCCX 7.0.1SR5 Time of Day as a parameter?

Unanswered Question

Is there a way to script Time of Day as a parameter?  I am trying to implement an open/close time for our call center within the script.  However, the open/close time will change depending on the client and when their DST starts and ends (DST is different with international clients).


I would like to be able to have one general script that is assigned to each client application, which can be modified individually, depending on the need.    For example:  Client A open time is 7am-6pm EST.  Client B is being implemented and needs an open time of 8am-5pm PST.  I would like to be able to make the change in Client B’s application by changing the parameter.    Is this possible or will I have to have a different script for each time zone? We are running UCCX version 7.0.1SR5.

Thanks you for your help,


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
ecornwell Fri, 09/10/2010 - 12:12

I want to bump this.  I just ran into the same thing.  I could combine 4 scripts into 1 if the time of day could be different between them.  I've read where you can do it with some Java but I really don't want to do it that way as it would make it more difficult to support.

Aaron Harrison Fri, 09/10/2010 - 12:19


On a typical deployment, my scripts read opening/closing times from an XML document and compare them to D[Now]. I usually also give customers a management IVR which allows them to dial in and change the opening/closing times, override the schedule and so on which basically writes that XML.

Whatever you do, the 'easiest to support' thing is to use the time-of-day/day-of-week steps as that's simple for everyone to understand. However, the easiest thing long term is to allow the end user (i.e. contact center supervisors etc) the ability to manage it themselves, which means giving them a way to do it without editing scripts - you guarantee problems if you have them regularly doing this.

You can do it without much java; but then you can't really do much with UCCX without a little java whether you realise it or not.

There are some examples in the script repository you can use for inspiration...



Please rate helpful posts...

ecornwell Fri, 09/10/2010 - 12:23

Thanks Aaron!

We have some things in place that allow them to manually open/close the call center and do some other little functions. The Time of Day settings are static but different by our call center region. IE: We have it split up so different agents service different parts of the country so they work different times. Except for the time of day, the scripts are identical. I was hoping to make a variable a parameter and be able to create each application off a single script.



Aaron Harrison Fri, 09/10/2010 - 12:26

Yeah, I make the name of the XML file the parameter. That way I have a single 'main' script, a single 'management' script, but those two are replicated for X departments/customers in different applications. Each application refers to the same common script, with an XML filename specific to that dept/customer. I also parameterise other options so you can tweak per dept/cust what the menu options/in-queue treatment, etc etc are.


sturcott9891 Thu, 01/06/2011 - 08:01

Hello Aaron, any way you can send me that script.  That sounds ideal for what I'm dealing with right now, that would be great.  Thanks!

yiosepvaldes Mon, 05/30/2011 - 17:36

hi aaron, can you send my a copy of your scripts? please, I'm having a similar problem where I need the time may be changed without having to enter the editor for end customer.


ecornwell Tue, 05/31/2011 - 05:27

I ended up getting it working.  Here was what I did:

1. Created 2 time parameters, 1 for open time and 1 for closed time.

2. Used an if statement to check those times against T[Now]
     ( T[now] >= OpenTime) && ( T[now]  < CloseTime )

3. Put the open and closed times in corretly in the app.

     OpenTime = T[8:00:00 AM PST]

     CloseTime = T[5:00:00 PM PST]

Right now I've got 4 apps using the same script that open and close at different times and it has worked great! I had one minior problem with a site in Arizona.  They don't observe DST so I had to change the time parameter a bit: OpenTime = T["7:00:00 AM", TZ[America/Phoenix]]

I hope that helps.

Jeff Clark Mon, 06/06/2011 - 06:54

Thanks ecornwell! Just tried this on a test script and it seems to work...just more testing to do with our more complex scripts! This makes things so much easier...no more editing and re-uploading scripts for me when senior management decide to be nice and close the offices early!


ecornwell Mon, 06/06/2011 - 07:02

Jeff, glad it's working for you!  It has come in very handy.  (Especially with call centers all over the US.)   For the closing early part, we put in another script that reads a database entry for the status of the call center.  A second script allows you (or whoever  you give access to) to call in and change the status of the call center.  I've done it with both a database read and through XML files.  Makes it nice if you need to change it real quick.  You can combine that with a prompt recorder and have someone record a custom prompt that only plays during those times as well.

yiosepvaldes Mon, 06/20/2011 - 06:35

hi ecornwell, sorry for the inconvenience and thanks for the help,

I'm having another problem with the script and the comparison of time.
when I enter the time range to declare the next step, everything works correctly when I do the update recently on the application, but when it takes hours to the next day, always gets stuck in the passage of time or outside defined range and does no good comparison.
the version of uccx I have is 7.0.1 but no upgrade or sr.

ecornwell Mon, 06/20/2011 - 08:17

Hi yiosepvaldes,

I'm not sure I understand your problem.  What hours are you trying to do? Could you explain in more detail?

yiosepvaldes Mon, 06/20/2011 - 11:41

ok, the problem I'm having is that when the server changes the date and time on its normal process (changing from Monday to Tuesday), the step of the comparison "if (T [now]> = OpenTime) & & (T [now]

only works fine when on the same day that the script upgrade or amount in the application.

ecornwell Mon, 06/20/2011 - 12:35

So your open and close hours span across days?  Or is is that the time zone differences cause that to happen? Can you proive the open and close times you're using?

yiosepvaldes Mon, 06/20/2011 - 12:48

Thanks again for help me,

I copy the way on that  I write the parameters in the application, this range of hours is the same day, Monday through Friday. the problem appear when change the day between monday to tuesday for example.

example 1:

start hour: T[02:05:00 PM]

close hour: T[03:05:00 PM]

example 2:

start hour: T[09:05:00 AM]

close hour: T[09:05:00 PM]

shraavan07 Wed, 12/19/2012 - 06:49

Hi, Ecornwell,

1. Created 2 time parameters, 1 for open time and 1 for closed time.

2. Used an if statement to check those times against T[Now]
     ( T[now] >= OpenTime) && ( T[now]  < CloseTime )

3. Put the open and closed times in corretly in the app.

     OpenTime = T[8:00:00 AM PST]

     CloseTime = T[5:00:00 PM PST]

Do you have sample script i can use it to look at?

Thank You,

ecornwell Wed, 12/19/2012 - 12:26

Here's what I have from my script: 

( T[now] >= OpenTime) && ( T[now]  < CloseTime )

One thing I found is there can be problems with Midnight and the if statement.  If the server time crosses midnight before the close time, you'll always get a false reading.  I only ran into this at one site and they only needed their hours changed for one day so I never tried to work around it.

I hope that helps.  If you still need the script, I can pull the if statement out. 


This Discussion

Related Content