js 截取字符串,转化为 Date 型
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
function parseDate(dateFormate) {
var year = dateFormate.substring(0, 4);
var month = dateFormate.substring(5, 7);
var day = dateFormate.substring(8, 10);
var hour = dateFormate.substring(11, 13);
var minute = dateFormate.substring(14, 16);
var second = dateFormate.substring(17, 19);
var date = new Date();
alert(year + "-" + month + " - " + day + "-" + hour + "-" + minute + "-" + second );
}
var year = dateFormate.substring(0, 4);
var month = dateFormate.substring(5, 7);
var day = dateFormate.substring(8, 10);
var hour = dateFormate.substring(11, 13);
var minute = dateFormate.substring(14, 16);
var second = dateFormate.substring(17, 19);
var date = new Date();
alert(year + "-" + month + " - " + day + "-" + hour + "-" + minute + "-" + second );
}
走向地狱的途中,不小心走了程序员这条路,路上一个个黑心的老板,和暗无天日的加班,我才发现,通往地狱的路径中,我们这行是最短的。