current应该是当前时间的时间戳,date应该是某天的时间戳
他俩相减是当前时间距离某天的毫秒数,但是除以一万我觉得他弄错了,除以100就是他的秒数
所以这个 seconds变量存的应该是当前时间与指定时间的秒数,但是除以10000应该改成除以100
<script language="javascript" type="text/javascript">var enabled = 0today = new Date()
var dayvar date
if(today.getDay()==0) day = "星期日 "
if(today.getDay()==1) day = "星期一 "
if(today.getDay()==2) day = "星期二 "
if(today.getDay()==3) day = "星期三 "
if(today.getDay()==4) day = "星期四 "
if(today.getDay()==5) day = "星期五 "
if(today.getDay()==6) day = "星期六 "
document.fgColor = " FF0072"
date1 =(today.getMonth() + 1 ) + "月" + today.getDate() + "日 "
date2 = day
document.write(date1.fontsize(2))
document.write(date2.fontsize(2))
document.write("<span id='clock'></span>")
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+ ":"
timeValue += ((minutes <10) ? "0" : "") + minutes + ":"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)