01-29-2019 03:57 PM - edited 03-14-2019 06:45 PM
Hi Guys!
Does anyone have experience with UCCX scripting in getting today's day of week through Date[now] function? or any Java function may be? Basically, I would like to get today's day of week in Monday, Tuesday.... format
P.S. Not interested in Day of Week Function as there's some specific requirement.
Regards
Taha
01-30-2019 06:51 AM
You can try:
//Create a New Calendar Object
java.util.Calendar cal = getInstance();
//Set the Day of the Week to Monday for Our Purposes
cal.set(cal.DAY_OF_WEEK, 2);
//Count which Monday 1-x we are in the Month
int weekMon = cal.get(cal.DAY_OF_WEEK_IN_MONTH);
as recommended in this post:
https://community.cisco.com/t5/contact-center/decision-based-on-week-of-the-month/td-p/2434262
01-30-2019 03:58 PM
I think the OP was asking, how to get today's day of week name. E.g., If today is January 30, 2019, then I should know that it's Wednesday.
If I'm right in what they were asking about, then one would do this:
Variables String[] weekday_names = new String[] {"", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"} Date today = D[now] String today_weekday_name = "" Script Steps Set today_weekday_name = weekday_names[today.dow]
Note: The weekday_names array has an empty element up front, this is just one way of solving the fact that array's are zero indexed and weekdays are 1 indexed. E.g., Sunday is 1, not 0.
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: