I'm getting date as string from Java output as: Wed Apr 27 09:56:56 CEST 2016
I would like to manually avoid typing "2016-04-2..etc" in my datetime field in my table during debug, and also avoid to create manual method for formating that date.
Instead, I would like to do this on the fly on database. I would like to convert given string format to date. I have tried many examples, but I couldn't solve it. Most close I found was this:
select convert(datetime, 'Wed Apr 27 09:56:56 CEST 2016', 127) from mytable
I need this in SQL Server 2012. Seems due to documentation (https://msdn.microsoft.com/en-us/library/ms187928.aspx), it can parse may formats, but it can't parse this kind of string I noticed.
Anybody knows how to convert this given string to date?