11-30-2004 02:35 AM - edited 03-13-2019 10:35 PM
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
11-30-2004 04:00 AM
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
Regards
Yogi
11-30-2004 04:11 AM
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
11-30-2004 05:42 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide