var dataArray = []; var regExp = new RegExp(/(\d{4})(\d{2})(\d{2})/); var weekTime = dojo.map(data,function(item,index){ regExp.test(item.exchange_date); return RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3; }); console.log(weekTime);dojo实现例如将20130222转换成2013-02-22 原文链接:https://www.f2er.com/dojo/290910.html