cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
661
Views
0
Helpful
3
Replies

Obtaining the Current Time in IPCC Express

paul.harrison
Level 4
Level 4

I'm writing a script that will allow callers to be authenticated and then make an onward call.

I have built the script OK but would like to be able to log the details of the caller, including Time of day.

I've tried using the create Java Object but the time is always returned as 00:00:00. I've also tried the Execute Java Method for returning GMT but this also returns the Time as 00:00:00. I can collect the date correctly but the time is always midnight.

Can anyone point me as to what I may be doing wrong or even provide me with a script extract that performs the required function.

Thanks

Paul

3 Replies 3

yogeswar
Level 4
Level 4

Hi Paul,

Hope your requirement is to get the value of current time. Refer the following procedure

1. Define a variable assume X of type "Time" in CRS editor.

2. Definie a variable of type string in CRS editor. Assume Y.

3. Use Execute Java Method step by setting the following properties

Select Variable : X

Method : public String toString()

Assign To Variable : Y

4. The time value will be stored in string variable Y in format "hh:mm:ss".

Do let me know if you need more.

Refer the following troubleshooting tip

http://www.cisco.com/en/US/partner/products/sw/custcosw/ps1846/products_qanda_item09186a0080204513.shtml

Regards

Yogi

In addition one more option to get current time is as follows

1. Define a variable assume CurrDate of type Date.

2. Definie 3 interger variables as intHrs, intMts and intSecs.

3. Use create java object to create an instance of Date class. Properties of Create java object is

Variable Name : CurrDate

Constructor : public java.util.Date

4. Use Execute Java method to extract the time value. set the properties as follows

Select Variable : CurrDate

Method : public int getHours

Assign To Variable : intHrs

The current hour value is stored in the interger variable intHrs.

5. Use Execute Java method to extract the time value. set the properties as follows

Select Variable : CurrDate

Method : public int getMinutes

Assign To Variable : intMts

The current minute value is stored in the interger variable intMts.

6. Use Execute Java method to extract the time value. set the properties as follows

Select Variable : CurrDate

Method : public int getSeconds

Assign To Variable : intSecs

The current second value is stored in the interger variable intSecs.

Regards

Yogi

Yogi,

You are a STAR.

I went with the second option you posted as I had all of this in places already, it was just the idea of using the date to extract the time that I hadn't done.

Thanks

Paul