String to timestamp conversion
807605Jul 9 2007 — edited Jul 9 2007I have a string of the format yyyyMMdd:hh:mm:ss.SSSSS.
I need to convert it to a timestamp value of
the format dd-MMM-yy hh.mm.ss.SSSSS.
I tried the following
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd:hh:mm:ss.SSSSS");
java.util.Date date = sdf.parse(stdate);
java.sql.Timestamp t = new java.sql.Timestamp(date.getTime());
but it didnt work.
Any help will be greatly appreciated.