I want to be able to convert the following string format to Datetime.
'21-04-2010 11:06'
I've looked here but there doesn't seem to be solution: http://msdn.microsoft.com/en-us/library/ms187928.aspx
convert(datetime, '21-04-2010 11:06', ??)
Has anyone else come across this problem? Or is it listed somewhere else?
You can use STR_TO_DATE date in MySQL to parse your String
Here the ref http://www.w3schools.com/sql/func_convert.asp Basically is
dd-mm-yyyy
formatTry this:
If it is sql server, use 105...like this:
it will work (sql server docs says that it is for 21-04-2010 ...but it will get your 11:06, too)