var formatedDate = dateString.replace( /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,'$1/$2/$3 $4:$5:$6');
console.log(formatedDate)
结果就是
2018/06/08 14:19:20
本文共 246 字,大约阅读时间需要 1 分钟。
var formatedDate = dateString.replace( /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,'$1/$2/$3 $4:$5:$6');
console.log(formatedDate)
结果就是
2018/06/08 14:19:20
转载于:https://www.cnblogs.com/MrzhangRecord/p/9155458.html