var str = "2016-09-23T06:25:41.773Z", reg = /\d+/g; str = str.match(reg) alert(str[2]+"-"+str[1]+"-"+str[0]+" "+str[3]+":"+str[4]+":"+str[5])