Generic function which accept all varchar type and return specific datetime format in Sql server
<p>Input: </p>

<pre><code>11-07-2016 14:21:59 
08/07/2016 5:12:52 PM
</code></pre>

<p>Output:</p>

<pre><code>2016-07-11 14:21:59
2016-07-08 17:12:52
</code></pre>

<p>My date in the format of <code>dd-mm-yyyy hh:mm:ss</code></p>

<p>The input need to return in specific format as <code>yyyy-mm-dd hh:mm:ss</code></p>

<p>Please suggest. </p>