关于实况HTML时钟的Script脚本代码
来源:互联网 作者:本站整理
摘要:推荐一段关于实况HTML时钟的Script脚本代码:Credit MUST stay intact for use*/function show2()if (!document.all)returnvar Digital=new Date(……
推荐一段关于实况HTML时钟的Script脚本代码:
Credit MUST stay intact for use*/
function show2(){
if (!document.all)
return
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="AM"
if (hours>12){
dn="PM"
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds+" "+dn
tick2.innerHTML="<b style='font-size:22;color:blue;'>"+ctime+"</b>"
setTimeout("show2()",1000)
}
window.onload=show2
//-->
</script>