zoukankan      html  css  js  c++  java
  • javascript显示年月日时间代码

    <!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>无标题文档</title>
    <script language=Javascript>
    function time(){
    //获得显示时间的div
    t_div = document.getElementById('showtime');
    var now=new Date()
    //替换div内容
    t_div.innerHTML = "现在是"+now.getFullYear()
    +"年"+(now.getMonth()+1)+"月"+now.getDate()
    +"日"+now.getHours()+"时"+now.getMinutes()
    +"分"+now.getSeconds()+"秒";
    //等待一秒钟后调用time方法,由于settimeout在time方法内,所以可以无限调用
    setTimeout(time,1000);
    }
    </script>
    </head>

    <body onload="time()">
    <div id="showtime"></div>
    <p>查找更多代码,请访问:<a href="http://www.lanrentuku.com/" target="_blank">懒人图库</a></p>
    </body>
    </html>

  • 相关阅读:
    X509IncludeOption 枚举
    SHA-1算法——(2)
    SHA-1算法
    消息摘要算法
    Oid 类
    @param注解
    类X509Certificate2
    sq分页
    svn不是内部或外部命令?
    PhpStorm配置svn:Can't use Subversion command line client:svn
  • 原文地址:https://www.cnblogs.com/meng520/p/3750941.html
Copyright © 2011-2022 走看看