js怎么把日期格式化成固定的日期

2025-04-08 13:29:13
推荐回答(1个)
回答1:

function FormatDate (strTime) {
    var date = new Date(strTime);
    return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
}
FormatDate("Tue Jul 16 01:07:00 CST 2013");