Some JavaScript engines can parse that format directly, which makes the task pretty easy:(一些JavaScript引擎可以直接解析该格式,这使得任务非常简单:)
function convertDate(inputFormat) {
function pad(s) { return (s < 10) ? '0' + s : s; }
var d = new Date(inputFormat);
return [pad(d.getDate()), pad(d.getMonth()+1), d.getFullYear()].join('/');
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…