SOURCE

function writeDocument(variable){
    document.write(variable + "<br/>");

}

writeDocument("定义时间对象--------")
var oprintdate = new Date (2019,5,1,15,59,58,999);
writeDocument ("打印2019年6月1日  星期六  15:59:59:999------ ");

oprintdate.setFullYear(2019);
writeDocument("年: " + oprintdate.getFullYear());
oprintdate.setMonth(6);
writeDocument("月: " + oprintdate.getMonth());
oprintdate.setDate(1);
writeDocument("日:" + oprintdate.getDate());
oprintdate.setHours(15);
writeDocument("时: " + oprintdate.getHours());
oprintdate.setMinutes(59);
writeDocument("分: " + oprintdate.getMinutes());
oprintdate.setSeconds(59);
writeDocument("秒: " + oprintdate.getSeconds());
oprintdate.setMilliseconds(999);
writeDocument("毫秒: " + oprintdate.getMilliseconds());
var weeks = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]

writeDocument("今天是" + weeks[oprintdate.getDay()]);




console 命令行工具 X clear

                    
>
console