Your regular expression isn't quite right, \d{8} will match 8 consecutive digits but there are colons in there as well, you need something like:
var str = "2017-01-08T16:06:52+00:00"
str = str.replace(/(\d{4})-(\d{2})-(\d{2})T(.{8}).*/, '$2 $3 $1, $4');
console.log(str)
To replace the month number with the name is just a little more work:
function reformatDate(s) {
var months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
var b = s.split(/\D/);
return b[2] + ' ' + months[b[1]-1] + ', ' + b[0] + ' ' + b[3] + ':' + b[4] + ':' + b[5];
}
var s = "2017-01-08T16:06:52+00:00"
console.log(reformatDate(s));
Be careful using the Date constructor (and Date.parse) for parsing strings, it's largely implementation dependent.
If you want to present the date and time in the timezone of the client, then parse the string to a Date, then return it as a string. A library like fecha.js is good for that. It's small and just does parsing and formatting, e.g.
var s = '2017-01-08T16:06:52+00:00'
var d = fecha.parse(s,'YYYY-MM-DDTHH:mm:ssZZ');
console.log(fecha.format(d,'dd MMMM, YYYY HH:mm:ss'));
new Date("2017-01-08T16:06:52+00:00").toLocaleString()or maybenew Date("2017-01-08T16:06:52+00:00").toGMTString().split(/\W/)to get the fancy names without a listSun,,08,Jan,2017,16,06,52,GMTwhich I suspect isn't what you intended either.p[1]+", " + p[3]+":" +p[5]+":"+p[2];or whatever... just another option ;)