02-17-2014 07:30 PM - edited 03-15-2019 05:58 AM
Hi Team
I have a situation to check time in routing script by comparing values with memory variable . Please help me to get answers of below mentioned queries.
1, Which 'data type ' need to use in user variable list to store time ( string ,date )
2 ,is it possible to check time if node like : time(Global.user_time)>time(21,45,00)
any other better options ?
regards
Renni john
02-18-2014 12:51 AM
Hi,
the recommended type for storing a time value: Float.
You did not write the details about filling that Global.user_time variable, but most likely: Global.user_time = now().
The now() built-in function returns the actual time.
If you want to compare two times, then yes, it's time(Global.user_time)>time(21,45,00) to see if the time is past 21:45:00.
G.
02-18-2014 06:02 PM
Hi Gergely
Thanks a lot for your fast reply .But we have a different situation , let me explain.
Since our central controller is configured with CET time ,we are planning to manage Time & DST change of different regions with Global user variables .
As per our plan , Admin script will fetch system time with the help of built in functions : hour() , minute() ,second() and modify Hours value based on region & DST changes , then concatenate and store modified hour , minute , second to Global variable . This variable will use to check TOD in routing script .
Does it make any sence ?
Regards
Renni john
02-18-2014 11:08 PM
Hi,
it makes sense but to be absolutely honest with you, I don't really see the reason why anything would be stored in a global variable.
What I would do is simply use time() > time(7,0) in an If node to decide where to route a call in a script serving a country in the CET timezone, and time() > time(8,0) in a script serving the UK - both will open at 7:00 in the morning, local time.
Otherwise, I would create three globals, integer type, one for storing the hour, the second the minute and optionally, the third storing the second value.
G.
02-19-2014 12:37 AM
Thanks Gergely
you are right ,if its a simple time check then its fine . But in our scenario, server configured with CET time and we have call centers in different regions and DST change makes more complexity in TOD .
If we consider North America , they have their own DST change and CET has also DST change , so 4 times we need to change the time in routing script .
I couldnt concatenate hours, minute, seconds to memory variable .But below mentioned logic works fine for NA, bcz the time difference will affect only to 'hours' part
1, Configured 2 Global variables , one for 'hour' and another for 'Weekday'.
2, Both variables are gettng modified by admin script based on Time different and DST .
3 ,Weekday and time variables will be checked in routing script ,for example if opening hours is Mon-Fri ( 8:00 -18:00) the configuration would be;
If node 1 : Global.user_weekday>1&&Global.user_weekday<7
If node 2 : time(Global.user_Hour,minute(),second())>time(6,00,00)&&time(Global.user_Hour,minute(),second())
Please let me know if you have any better idea to solve this situation.
Regards
Renni John
03-14-2014 01:56 AM
We have implemented this logic for NA and it worked fine .
Regards
Renni John
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