[cisco-voip] How to set Date Format in UCCX for SQL
Anthony Holloway
avholloway+cisco-voip at gmail.com
Tue Nov 15 14:03:04 EST 2011
First, D[now] does not output anything. It's an object constructor for the
java.util.Date class. In fact, it's specific to Cisco's UCCX product, so
you will not find anything about it at the java documentation site.
Now, let's explore what D[now] is actually doing...
D[] is a wrapper on java's "new Date()" constructor for creating new Date
objects based on the java.util.Date class. It also includes some
enhancements.
To get a full run down on what a Date object can offer, please see:
http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html
To get a full run down on what enhancements D[] brings to the table, please
see: (Page 3-38)
http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/crs/express_8_5/programming/guide/uccx851_exp_lang.pdf
The "now" keyword is simply a way to tell the interpreter that you wish to
use the date/time (timestamp) of when the code is executed. So, today at
3:00pm the value of "now" will be different from what it will be tomorrow.
Using the constructor, plus the keyword: D[now], is an instruction to
create a Date object whose initial value is the current timestamp of when
it's executed. The time comes from the computer running the code, and in
most cases this means the UCCX server. So if your time is off in the
script, it's also off on the server.
It's also important to know: if you create a new Date object, and set it's
initial value to D[now], the timestamp will be computed when the script's
Start step is executed, but if you set it's value somewhere in the script
logic, say, in the queue loop, then the value will not be computed until
that step is executed. That means that, two Date variables in the same
script: one set initially, and one set just after the Start step, could
have different values. Date is as precise as 1/1,000th of a second.
If you wanted to output the Date in some human readable format, you could
look at a quick solution like using the Set step to set a String variable
equal to the Date variable. The Set step will call the Date objects
.toString() method automatically and then take that result and store it in
the String variable. The default format is: dow mon dd hh:mm:ss zzz yyyy,
and can be seen here:
http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html#toString()<http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html#toString>
I hope this helps explain it a bit better.
-Anthony
On Tue, Nov 15, 2011 at 8:11 AM, Ian Tait <ian.t at thoughtbubble.net> wrote:
> What does D[now] output?
>
> Ian
>
> ________________________________
>
> From: cisco-voip-bounces at puck.nether.net
> [mailto:cisco-voip-bounces at puck.nether.net] On Behalf Of shary shary
> Sent: 14 November 2011 14:56
> To: cisco-voip at puck.nether.net
> Subject: [cisco-voip] How to set Date Format in UCCX for SQL
>
>
> Having another challenge, i am getting UCCX current date using D[now]
> but need to forward this date to SQL through Write Query and the format
> i have through D[now] doesn't work with SQL so i need to change this
> format to SQL Format and then need to store in some variable so i can
> push the date towards SQL DB. I am stuck to make format or equation,
> appreciate any quick response.
>
>
> Regards
>
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20111115/2126e779/attachment.html>
More information about the cisco-voip
mailing list