function share_data_time() {
window.setTimeout("share_data_time()", 1000);
//毕业时间
BirthDay = new Date("5/11/2018 00:00:00");
//获取当前时间
today = new Date();
timeold = (today.getTime() - BirthDay.getTime()); //总豪秒数
secondsold = Math.floor(timeold / 1000); //总秒数
e_daysold = timeold / (24 * 60 * 60 * 1000);
daysold = Math.floor(e_daysold); //相差天数
e_hrsold = (e_daysold - daysold) * 24;
hrsold = Math.floor(e_hrsold); //相差小时数
e_minsold = (e_hrsold - hrsold) * 60;
minsold= Math.floor(e_minsold) //相差分钟数
seconds = Math.floor((e_minsold - minsold) * 60); //相差秒数
//将所获取的时间拼接到一起,再把值显示到页面
share_time.innerHTML = "已毕业:" + daysold + "天" + hrsold + "小时" + minsold + "分" + seconds + "秒";
}
share_data_time();
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。