在网页上添加一个更新时间的代码

[复制链接]
查看: 1062   回复: 1
发表于 2009-2-1 13:54:41 | 显示全部楼层 |阅读模式
这段代码可以添加到你网页上,这样给人感觉你的站每天都在更新,尤其适合评论站!
  1. <div id="Update"><script>

  2. var mydate=new Date()
  3. var year=mydate.getYear()
  4. if (year < 1000)
  5. year+=1900
  6. var day=mydate.getDay()
  7. var month=mydate.getMonth()
  8. var daym=mydate.getDate()
  9. if (daym<10)
  10. daym="0"+daym
  11. var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
  12. var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
  13. document.write("Last Updated: "+montharray[month]+" "+daym+", "+year+"")

  14.         </script></div>
复制代码
演示:Last Updated: February 01, 2009

评分

参与人数 2 +8 收起 理由
nod32 + 3
txf861 + 5

查看全部评分

发表于 2009-2-17 12:20:20 | 显示全部楼层
有意思的东东        
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则