99欧美日本一区二区留学生-丰满顿熟妇好大bbbbbβ -婷婷五月六月激情综合色中文字幕-永久免费AV网站可以直接看的

萬(wàn)象時(shí)代LOGO

使用JS(javascript)顯示年月日時(shí)間代碼

DATE:2015-01-24 已瀏覽
455

通常我們做網(wǎng)站客戶會(huì)需要再網(wǎng)站中加上實(shí)時(shí)的年與日,其實(shí)用很多方法都可以實(shí)現(xiàn),用一個(gè)簡(jiǎn)單js也是比較省心的事情。

如下就是代碼,可以復(fù)制看下效果:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無(wú)標(biāo)題文檔</title>
 <script language=Javascript> 
  function time(){
    //獲得顯示時(shí)間的div
    t_div = document.getElementById('showtime');
   var now=new Date()
    //替換div內(nèi)容 
   t_div.innerHTML = "現(xiàn)在是"+now.getFullYear()
    +"年"+(now.getMonth()+1)+"月"+now.getDate()
    +"日"+now.getHours()+"時(shí)"+now.getMinutes()
    +"分"+now.getSeconds()+"秒";
    //等待一秒鐘后調(diào)用time方法,由于settimeout在time方法內(nèi),所以可以無(wú)限調(diào)用
   setTimeout(time,1000);
  }
</script>
</head>

<body  onload="time()">
<div id="showtime"></div>
<p>查找更多代碼,請(qǐng)?jiān)L問:<a href="http://www.wap.sooo12.cn/" target="_blank">萬(wàn)象時(shí)代</a></p>
</body>
</html>