zoukankan      html  css  js  c++  java
  • 网页时钟 当前时间 备留

    <body bgcolor="#fef4d9" ONLOAD=show5()>
    ////////////////////////////////////////////////////
    ////////////////////////////////////////////////
    ///////////////////////////////////////////////
    <script language="JavaScript">
    <!-- Hide
      var timerID = null
      var timerRunning = false
      function stopclock (){
      if(timerRunning)
      clearTimeout(timerID);
      timerRunning = false
      }
      function showtime () {
      var now = new Date();
      var year = now.getYear();
      var month = now.getMonth() + 1;
      var date = now.getDate();
      var hours = now.getHours();
      var minutes = now.getMinutes();
      var seconds = now.getSeconds();
      var day = now.getDay();
      Day = ["星期天","星期一","星期二","星期三","星期四",""星期五","星期六"];

      var timeValue = "";
      timeValue += (year<1000?year+1900:year) + "年";
      timeValue += (month < 10 ? "0" : "") + month + "月";
      timeValue += (date<10?"0":"") + date + "日  ";
      timeValue += (Day[day]) + "  ";
      timeValue += (hours < 10?"0":"")+hours;
      timeValue += (minutes < 10? ":0" : ":") + minutes;
      timeValue += (seconds < 10? ":0" : ":") + seconds;
      //timeValue += (hours < 12) ? "上午" : "下午";
      document.jsfrm.face.value = timeValue;
      timerID = setTimeout("showtime()",1000);
      timerRunning = true
      }
      function startclock () {
      stopclock();
      showtime()
      }
      //-->

    </script>
     <form name='jsfrm'>
                        <input type=text name='face' size=34 value=''>
                      </form>

    <body bgcolor="#fef4d9" onLoad="startclock()">

  • 相关阅读:
    hdu4331 Image Recognition 就暴力啊。。啊。。
    [置顶] ASP.Net中服务器控件的生命周期
    Windows下通过脚本快速修改IP地址
    java对象转json应clone,避免生成json串有问题
    Oracle表空间常用操作
    redhat5安装jdk6、eclipse和tomcat6
    Oracle 表的常见操作
    一道来自华为的C机试题目
    [置顶] 获取系统时间的方法--linux
    html5 命运之轮生产
  • 原文地址:https://www.cnblogs.com/Denny_Yang/p/2530487.html
Copyright © 2011-2022 走看看