how to split date to formatted date and time
<p>I am getting a date like </p>

<pre><code>20160509125119040 
</code></pre>

<p>from back end database.
I need to change it like </p>

<pre><code> 2016-05-09 12:51:19 
</code></pre>

<p>in javascript.plz help me</p>