flash倒计时脚本显示今天是undefined年NaN月undefined日 星期undefined undefine
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 14:01:40
flash倒计时脚本显示今天是undefined年NaN月undefined日 星期undefined undefined:undefined:undefined
nowdata = new Date();
year = nowdate.getFullYear();
month = nowdate.getMonth()+1;
date = nowdate.getDate();
day = nowdate.getDay();
hour = nowdate.getHours();
minute = nowdate.getMinutes();
second = nowdate.getSeconds();
enddate = new Date(2008,8,8,20,0,0);
shijiancha = (enddate.getTime()-nowdate.getTime())/1000;
shengyutian = Math.floor(shijiancha/(3600*24));
shengyuxiaoshi = Math.floor((shijiancha-shengyutian*3600*24)/3600);
shengyufen = Math.floor((shijiancha-shengyutian*24*3600-shengyuxiaoshi*3600)/60);
shengyumiao=Math.floor(shijiancha-shengyutian*24*3600-shengyuxiaoshi*3600-shengyufen*60);
outtime1="今天是"+year+"年"+month+"月"+date+"日 星期"+day+" "+hour+":"+minute+":"+second;
显示因该是:今天是2008年5月13日 星期2 15:40:50
大虾又解决的必会加以重谢!
nowdata = new Date();
year = nowdate.getFullYear();
month = nowdate.getMonth()+1;
date = nowdate.getDate();
day = nowdate.getDay();
hour = nowdate.getHours();
minute = nowdate.getMinutes();
second = nowdate.getSeconds();
enddate = new Date(2008,8,8,20,0,0);
shijiancha = (enddate.getTime()-nowdate.getTime())/1000;
shengyutian = Math.floor(shijiancha/(3600*24));
shengyuxiaoshi = Math.floor((shijiancha-shengyutian*3600*24)/3600);
shengyufen = Math.floor((shijiancha-shengyutian*24*3600-shengyuxiaoshi*3600)/60);
shengyumiao=Math.floor(shijiancha-shengyutian*24*3600-shengyuxiaoshi*3600-shengyufen*60);
outtime1="今天是"+year+"年"+month+"月"+date+"日 星期"+day+" "+hour+":"+minute+":"+second;
显示因该是:今天是2008年5月13日 星期2 15:40:50
大虾又解决的必会加以重谢!
前八句改成如下的代码,第一句不要
year = new Date().getFullYear();
month = new Date().getMonth()+1;
date = new Date().getDate();
day = new Date().getDay();
hour = new Date().getHours();
minute = new Date().getMinutes();
second = new Date().getSeconds();
year = new Date().getFullYear();
month = new Date().getMonth()+1;
date = new Date().getDate();
day = new Date().getDay();
hour = new Date().getHours();
minute = new Date().getMinutes();
second = new Date().getSeconds();