IVR Script with Java.Sql.Timestamps

Version 1
    This document was generated from CDN thread

    Created by: Jose De leon morales on 22-11-2010 06:10:08 PM
    Now, I developed an IVR script with Oracle 10G database and it works great. When I try to use a date variable in oracle the CRS Editor reconize the variable as Java.Sql.Timestamp, and it work well. But we usea a prompt and display in the prompt the java.sql.Timestamp and display the date, but in this format: 'dd/mm/yy' but we want display the date in 'dd/mm/yyyy'. I try to modified the IPCC current region, system default but it does'nt work.
     
    Thanks in advance.
     
    Regards!

    Subject: RE: IVR Script with Java.Sql.Timestamps
    Replied by: Steven Pawlak on 23-11-2010 03:57:44 PM
    To get custom dates you need to venture beyond the docs and into the Java expressions. 
     
    Create a new variable (sdfVar1) and use "java.text.SimpleDateFormat" as its type. This is not an option in the pull down and has to be typed in. 
     
    Then in the code use a Set step to set the variable (sdfVar1) you just made to 
    new java.text.SimpleDateFormat ("MM/dd/yyyy")
     
    Then later in the code where you get the Java.sql.Timestamp (call it tsVar1) you need to have a date variable (dateVar1) and use a Set step to pass it thru the sdf. 
     
    Set Step
    Variable: dateVar1
    Value: sdfVar1.parse(tsVar1)
     
    This will parse the Timestamp value thru the SimpleDateFormat that you defined and out the value into dateVar1 so that you can use the data value with the format you want in your code. 
     
    You could also do all this in the Expressions editor of a single Set step and wrap all this in Java. But that is another class ;)
     
     
    Now, I developed an IVR script with Oracle 10G database and it works great. When I try to use a date variable in oracle the CRS Editor reconize the variable as Java.Sql.Timestamp, and it work well. But we usea a prompt and display in the prompt the java.sql.Timestamp and display the date, but in this format: 'dd/mm/yy' but we want display the date in 'dd/mm/yyyy'. I try to modified the IPCC current region, system default but it does'nt work.
     
    Thanks in advance.
     
    Regards!