📜  jquery 中的日期格式 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:39.034000             🧑  作者: Mango

代码示例6
$.date = function(dateObject) {
    var d = new Date(dateObject);
    var day = d.getDate();
    var month = d.getMonth() + 1;
    var year = d.getFullYear();
    if (day < 10) {
        day = "0" + day;
    }
    if (month < 10) {
        month = "0" + month;
    }
    var date = day + "/" + month + "/" + year;

    return date;
};