<div>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.</div>
<div> </div>
<div>Now, let's explore what D[now] is actually doing...</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>To get a full run down on what a Date object can offer, please see: <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html">http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html</a></div>
<div> </div>
<div>To get a full run down on what enhancements D[] brings to the table, please see: (Page 3-38) <a href="http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/crs/express_8_5/programming/guide/uccx851_exp_lang.pdf">http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/crs/express_8_5/programming/guide/uccx851_exp_lang.pdf</a></div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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: <a href="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()</a></div>
<div> </div>
<div>I hope this helps explain it a bit better.</div>
<div> </div>
<div>-Anthony<br></div>
<div class="gmail_quote">On Tue, Nov 15, 2011 at 8:11 AM, Ian Tait <span dir="ltr"><<a href="mailto:ian.t@thoughtbubble.net">ian.t@thoughtbubble.net</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">What does D[now] output?<br><br>Ian<br><br>________________________________<br><br>From: <a href="mailto:cisco-voip-bounces@puck.nether.net">cisco-voip-bounces@puck.nether.net</a><br>
[mailto:<a href="mailto:cisco-voip-bounces@puck.nether.net">cisco-voip-bounces@puck.nether.net</a>] On Behalf Of shary shary<br>Sent: 14 November 2011 14:56<br>To: <a href="mailto:cisco-voip@puck.nether.net">cisco-voip@puck.nether.net</a><br>
Subject: [cisco-voip] How to set Date Format in UCCX for SQL<br>
<div class="HOEnZb">
<div class="h5"><br><br>Having another challenge, i am getting UCCX current date using D[now]<br>but need to forward this date to SQL through Write Query and the format<br>i have through D[now] doesn't work with SQL so i need to change this<br>
format to SQL Format and then need to store in some variable so i can<br>push the date towards SQL DB. I am stuck to make format or equation,<br>appreciate any quick response.<br><br><br>Regards<br><br><br>_______________________________________________<br>
cisco-voip mailing list<br><a href="mailto:cisco-voip@puck.nether.net">cisco-voip@puck.nether.net</a><br><a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><br>
</div></div></blockquote></div><br>