function writeDocument(variable) {
document.write(variable + "<br/>");
}
writeDocument("定义时间对象--------------------");
var oToday=new Date();
writeDocument("获取年,月,日,时,分,秒,毫秒--------");
writeDocument("年:"+oToday.getFullYear());
writeDocument("月:"+oToday.getMonth());
writeDocument("日:"+oToday.getDay());
writeDocument("时:"+oToday.getHours());
writeDocument("分:"+oToday.getMinutes());
writeDocument("秒:"+oToday.getSeconds());
writeDocument("毫秒:"+oToday.getMilliseconds());
writeDocument("设置年 月 星期 日 时 分 秒 毫秒");
var oTime=new Date();
oTime.setFullYear(2019);
writeDocument("年:"+oTime.getFullYear());
oTime.setMonth(6);
writeDocument("月:"+oTime.getMonth());
oTime.setDate(6);
writeDocument("日:"+oTime.getDate());
oTime.setHours(6);
writeDocument("时:"+oTime.getHours());
oTime.setMinutes(6);
writeDocument("分:"+oTime.getMinutes());
oTime.setSeconds(6);
writeDocument("秒:"+oTime.getSeconds());
oTime.setMilliseconds(666);
writeDocument("毫秒:"+oTime.getMilliseconds());
var weeks=["星期天","星期一","星期二","星期三","星期四","星期五","星期六"];
writeDocument
console