SOURCE

var data = Date()
//console.log(data)

function disp_prompt() {
    for (var i = 1; i < 3; i++) {//循环弹出窗口进行输入信息
        var msg = prompt("请输入学号 姓名 三个成绩");
        var msgArray = msg.split("");//使用split函数可以删除字符串中的特定字符
        document.write(msgArray + "</br>"); //"</br>"可以在循环中实现换行效果
    }
}
//var a1=disp_prompt();

function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    var hours = date.getHours();
    var minutes = date.getMinutes();
    var seconds = date.getSeconds();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentDate = year + seperator1 + month + seperator1 + strDate + " " + hours + seperator2 + minutes + seperator2 + seconds;
    var currentDay = year + "." + month + "." + strDate;
    var currentTime = hours + seperator2 + minutes + seperator2 + seconds;
    console.log(currentDate);
    console.log(currentDay);
    console.log(currentTime);
    return currentDate;
 

}
var a2 = getNowFormatDate();
console 命令行工具 X clear

                    
>
console