Cisco Support Community
Community Member

SQL Timestamp java.sql.Timestamp


I have done a search and could not find a discussion related to grabbing the time from SQL in a specific format that I am looking for, so I am seeking your wisdom here.

I am querying the Quality Management database to retrieve the localStartTime field name for a specific call and storing it in a variable named QMCallStartTime. In order to make this work, I had to set this variable be type java.sql.Timestamp.

10-11-2013 3-16-18 PM.jpg

I am then converting QMCallStartTime into a String so that I can manipulate it (I am parsing out the hour, minute, and second by substring). I am expecting the String to store the time in the following format, for example: 09:07:53 AM PDT. However, the time is being stored as 9:07 AM. In the Set object, I have the option to choose an encoding option for the QMCallStartTime variable. No matter if I set it to Medium Time or Long Time, it seems to be defaulting to Short Date (the top option) after I re-open the Set object.

10-11-2013 3-12-06 PM.jpg

Any insight?

Thank you so very much for reading this.


Community Member

SQL Timestamp java.sql.Timestamp

If anyone is interested, I set the string = QMCallStartTime.toString() and the output is in the

YYYY-MM-DD HH:MM:SS.NNN format. I can then break it apart from there using substring().

CreatePlease to create content