I’m trying to set up a routing rule that checks if the current day is a weekend. I see two functions in the expression builder: DateTimeDiff and GetDayOfWeek.
I tried using GetDayOfWeek() which returns an integer (1-7). My logic is IF(GetDayOfWeek() > 5, true, false). This seems to work for identifying Saturday (6) and Sunday (7).
However, I’ve also seen people use DateTimeDiff to calculate the difference between the current time and a reference date. I’m not sure if that’s necessary here or if it’s just for calculating durations.
Is there a performance difference between using a simple integer comparison on GetDayOfWeek() versus using DateTimeDiff? I want to make sure I’m not overcomplicating the expression. Also, does GetDayOfWeek() handle timezone shifts correctly if the architect is set to US/Eastern but the user is in a different zone? I don’t want to route calls incorrectly on Friday evening.
Here’s the expression I’m testing:
IF(GetDayOfWeek() > 5, 'Weekend Queue', 'Standard Queue')
Any insights on best practices here?