Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?



shivaraj wrote:
Hi,
In my JAVA code I have a string in "15:45 03/17/2007" this format.
Could any one let me know how can i insert/update it on to sql
database where the column is of type datetime ? If any one has a
sample code to do this, that will be great.

Your subject line says "hh:mm dd/mm/yyyy" but the example you quote is not a valid date in that format, there is no month 17.

I'd use String split to decompose the date and time and the use String concatenation to reassemble the parts in the form expected by SQL.
.



Relevant Pages