凉了个林
2020-06-14 19:02
var mydate = new Date();
var myyear = myday.getFullYear();
var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
document.write("年份" + myyear);
document.write("今天是:" + weekday[mydate.getDay()]);
var myydate = new Date();
document.write("当前时间:" + myydate + "<br>");
mydate.setTime(myydate.getTime() + 60 * 60 * 1000);
document.write("推迟一小时时间:" + myydate);
var myyydate = new Date();
document.write("当前时间:" + myyydate + "<br>");
myyydate.setTime(myyydate.getTime() + 2 * 60 * 60 * 1000);
document.write("推迟二小时时间:" + myyydate);
var mydate = new Date();
var myyear = myday.getFullYear(); //这里的myday改成mydate
var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
document.write("年份" + myyear);
document.write("今天是:" + weekday[mydate.getDay()]);
var myydate = new Date();
document.write("当前时间:" + myydate + "<br>");
mydate.setTime(myydate.getTime() + 60 * 60 * 1000);//mydate改为myydate
document.write("推迟一小时时间:" + myydate);
要细心啊
var myyear = myday.getFullYear();这一行改为:
var myyear = mydate.getFullYear();
var mydate = new Date();
var myyear = myday.getFullYear(); //这里哪来的myday?
var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
document.write("年份" + myyear);
document.write("今天是:" + weekday[mydate.getDay()]);
然后我把它们单独放到一个文件里面又可以了????这到底是为什么
?????这到底是为什么
JavaScript进阶篇
468061 学习 · 21891 问题
相似问题