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()">

  • 相关阅读:
    五、敏捷开发框架 初识组件式开发
    winform 控制Text Box只能输入英文数字和退格键
    WPF 常用控件属性
    问题分析
    串口通讯学习
    解决MVC中Model上的特性在EF框架刷新时清空的问题
    论序列化与反序列化
    dynamics 365 安全角色及权限
    .NET Core 依赖注入框架 框图笔记
    C#基本类型的取值范围与 .NET框架类型的对应
  • 原文地址:https://www.cnblogs.com/Denny_Yang/p/2530487.html
Copyright © 2011-2022 走看看