cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1284
Views
0
Helpful
2
Replies

Uccx comparing time objects in script crossing dates

rore
Level 1
Level 1

Hi There!

Im using Jonathan Schulenberg sub_datetime.aef script which is an awesome script for grabbing
Timezone,currentTime,currentTimeInt date and dayofweek information.


I have implemented a script at a customer site using this logic and it works great!
But i bumped into a weakness in my solution that i wonder íf somebody can help out with!
For instance if i compare if a queue shall be open or closed by doing an IF on the following logic

If (currentTimeInt >= 070000 && currentTimeInt <= 180000) Then
True -> Goto CSQ-Step
False -> Goto ClosedPrompt, that works ok
But if i want to compare

If (currentTimeInt >= 070000 && currentTimeInt <= 010000) and trying to do same logic it fails....

because in some cases my customer want to keep a queue open to 010000 AM due to extend their support open hours!
The question is are there any built-in script method or function that can be used when do a compare on PM and AM times and then crossing dates. I
IF so this way you could have a fully controlled TOD/DayOfWeek where several application/scripts could use a common SQL DB for storing business hours, exceptions etc.


Somebody?!

rgds Mikael

2 Replies 2

geoff
Level 10
Level 10

surely you just need two clauses:

if (currentTimeInt <= 10000 || (currentTimeInt >= 70000 && currentTimeInt <= 240000))

watch out for days of the week. Monday is not going to be open between 12am and 1am, and Saturday is not going to have the second clause,

Regards,

Geoff

Hi Geof!!

Thx. for you reply! I shall test this since i already check weekday-numbers in my logic!

Just a thought normally i think the CurrentimeInt returns 010000 (when 01:00 am) so i guess you mean that i shall

read a Substring of 010000 i.e dig out 10000 from the variable, right?!

Are there any other ways to do it with T[now] functionality or so?

rgds, Mikael