显示时间的JavaScript代码

上传人:tang****xu2 文档编号:141701977 上传时间:2020-08-11 格式:DOCX 页数:2 大小:28.77KB
返回 下载 相关 举报
显示时间的JavaScript代码_第1页
第1页 / 共2页
显示时间的JavaScript代码_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《显示时间的JavaScript代码》由会员分享,可在线阅读,更多相关《显示时间的JavaScript代码(2页珍藏版)》请在金锄头文库上搜索。

1、显示年月日,星期,早晚,时钟!-calendar = new Date();day = calendar.getDay();month = calendar.getMonth();date = calendar.getDate();year = calendar.getYear();if (year 100) year = 1900 + year;cent = parseInt(year/100);g = year % 19;k = parseInt(cent - 17)/25);i = (cent - parseInt(cent/4) - parseInt(cent - k)/3) + 19

2、*g + 15) % 30;i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1)*parseInt(21-g)/11);j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4) % 7;l = i - j;emonth = 3 + parseInt(l + 40)/44);edate = l + 28 - 31*parseInt(emonth/4);emonth-;var dayname = new Array (星期日,星期一,星期二,星期三,星期四,星期五

3、,星期 六);var monthname =new Array (1 月,2 月,3 月,4 月,5 月,6 月,7 月,8 月,9 月”,”10 月”,”11 月”,”12 月);document.write(+year + 年);document.write(monthnamemonth);document.write(date + 日+);document.write(daynameday+ +);/ January(1月份节日,以下同。)document.write();/-!-document.write();var now,hours,minutes,seconds,timeValue;function showtime()(now = new Date();hours = now.getHours();minutes = now.getMinutes();seconds = now.getSeconds();timeValue = (hours = 12) ? 下午”:上午;timeValue += (hours 12) ? hours - 12 : hours) + 点”;timeValue += (minutes 10)?0:) + minutes+ 分;timeValue += (seconds

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号