Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert an SQL Timestamp to a String

843854Mar 4 2005 — edited Mar 4 2005
Hi,

Trying to get a Timestamp like 2005-03-03 14:35:39.0 to a string so i can chop off both ends and have it lookin like 03-03 14:35 .

Retriveing a Timestamp from the DB with
 mess_date = rs.getTimestamp("x");
Then attempting this
 string_date = Timestamp.toString(mess_date);
 my_date = string_date.substring(5,16); 
Am I going about this the right way?

Any suggestions greatly appreciated
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2005
Added on Mar 4 2005
2 comments
378 views