Guest

Cisco Unified Contact Center Express

Obtain the Current Date When Writing a Cisco CRS Script

Document ID: 48141



Questions

Introduction
How to obtain the current date when you write a CRS script?
NetPro Discussion Forums - Featured Conversations
Related Information

Introduction

This document discusses how to obtain the current date when you develop a script with the help of the Cisco Customer Response Solutions (CRS) Application Editor in a Cisco IP Contact Center (IPCC) Express Edition environment.

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Note: Cisco recommends that you have basic knowledge of CRS scripting.

Q. How to obtain the current date when you write a CRS script?

A. Java objects can be used for date comparisons. However, to do this, it is necessary to obtain the current date. Here is the step-by-step procedure to obtain the current date:

  1. Add a Create Java Object step (see Step 1 in Figure 1). The variable name is dateObject and data type is Date. The constructor is java.util.Date().
  2. Add an Execute Java Method step to get the current year (see Step 2 in Figure 1). The method is getYear(). The result is assigned to currentYear, which is an integer variable.

    Note: The getYear(0) method returns a value, which is 1900 less than the calendar year. In order to correlate to the correct calendar year, 1900 should be added to the returned value. This step is not shown in the sample script.

  3. Add an Execute Java Method step to get the current month (see Step 3 in Figure 1). The method is getMonth(). The result is assigned to currentMonth, which is an integer variable.

    Note: The getMonth(0) method returns 0-11 for month value. In order to correlate to 1-12 calendar month value, currentMonth is increased by 1.

  4. Add an Execute Java Method step to get the current date (see Step 4 in Figure 1). The method is getdate(). The result is assigned to currentDate which is an integer variable.
Figure 1 – Sample Script

qa-currentdate-1.gif

Note: The purpose of this sample script is to demonstrate how to obtain the current date.

NetPro Discussion Forums - Featured Conversations

Networking Professionals Connection is a forum for networking professionals to share questions, suggestions, and information about networking solutions, products, and technologies. The featured links are some of the most recent conversations available in this technology.
NetPro Discussion Forums - Featured Conversations for Customer Contact Software
IP Communications and Video: Contact Center

Related Information



Updated: Apr 06, 2005Document ID: 48141