演
示
源
代
码
数字钟
注释:放在<body>与</body>之间
<script language="JavaScript"> <!-- Begin Stamp = new Date(); document.write('<font size:"9pt" face="Arial"><B>' + Stamp.getYear() + "年"+ (Stamp.getMonth() + 1) +"月"+Stamp.getDate()+"日"+" " +'</B></font>'); var Hours; var Mins; var Time; Hours = Stamp.getHours(); if (Hours >= 12) { Time = " 下午"; } else { Time = " 上午"; } if (Hours > 12) { Hours -= 12; } if (Hours == 0) { Hours = 12; } Mins = Stamp.getMinutes(); if (Mins < 10) { Mins = "0" + Mins; } document.write('<font size:"9pt" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>'); // End --> </script>
当前位置:
首 页
→JavaScript
→
日期时间
→数字钟
··万旭网站工作室 设计发布··