cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
476
Views
10
Helpful
2
Replies

Time comparisons on date of DST changes

DanCook85439
Level 1
Level 1

We have a script that reads in the hours of operation from the XML file shown below:

<NormalHours>
<OpenTime>07:00:00</OpenTime>
<CloseTime>22:00:00</CloseTime>
<FriOpenTime>07:00:00</FriOpenTime>
<FriCloseTime>21:00:00</FriCloseTime>
<WeekendOpenTime>10:00:00</WeekendOpenTime>
<WeekendCloseTime>16:00:00</WeekendCloseTime>
<LastUpdated>August 24, 2020 7:04:40 AM EDT.</LastUpdated>
<UpdatedBy>4334</UpdatedBy>
</NormalHours>
 
Using IF statements combined with Day of Week statements, the hours are stored as a string, then converted into the time variables tnOpenTime and tnCloseTime.  On a weekend, these statements get executed:
 
Set sOpenTime = sWeekendOpenTime
Set sCloseTime = sWeekendCloseTime
tnOpenTime = Time.valueOf(sOpenTime)
tnCloseTime = Time.valueOf(sCloseTime)
 
On any normal day, the statement that checks to see if the office is open works correctly:
If (T[now] >= tnOpenTime) and (T[now] < CloseTime) will open the office at 10:00 and close the office at 16:00 on the weekend.
 
On a day when there is a DST change, the office will open and close one hour +/- the correct time depending on which way the clocks change.  During the most recent change, we could see from the logs that any callers between 10:00am and 11:00am were sent to voicemail and the part of the script that checks for a condition when the office is open but no agents are logged in triggered at 16:15 after the office was closed.
 
The following day everything is back to normal.  I didn't catch it in time to do a debug trace on the day of the time change.  I have no idea why this happens or how to troubleshoot it.  I was able to confirm with Cisco TAC that this is not a bug.  UCCX version is 11.6.1
 
2 Replies 2

jim-j
Level 3
Level 3

That is weird, don't know why that would happen.  If you wanted to try something else to simply see if you can avoid the problem you could use date objects instead of time objects like this:

Set timeToCheck_date = D[now] //This is eastern time in my case
Set todaysDate_str = D[now] //gets set to something like "2/8/2017"
Set timeZone_tz = "America/Chicago"
Set startTime_str = "4:00 PM"
Set startTime_date = D[todaysDate_str + " " + startTime_str, timeZone_tz] 
If timeToCheck_date.after(startTime_date)
	True = timeToCheck occurs after the startTime
	False = timeToCheck occurs before the startTime

That code snippet is what I posted here:

https://supportforums.cisco.com/discussion/11982946/uccx-9-time-day-time-ranges

That thread contains a lot more good time info.

 

Thanks for the tip and the link to article with more detail on times and dates in UCCX.  I'll certainly give it a try and see what happens when the DST ends.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: