js日期轉換函式

落地僧發表於2016-01-26
//js定義日期轉換函式
function FormatDate (strTime) {
    var date = new Date(strTime);
    //年-月-日
    return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
}

相關文章