• jquery实现时间走动


     function getdates() {
                var w_array = new Array("星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
                var d = new Date();
                var year = d.getFullYear();
                var month = d.getMonth() + 1;
                var day = d.getDate();
                var week = d.getDay();
                var h = d.getHours();
                var mins = d.getMinutes();
                var s = d.getSeconds();

                if (month < 10) month = "0" + month;
                if (day < 10) day = "0" + day;
                if (h < 10) h = "0" + h;
                if (mins < 10) mins = "0" + mins;
                if (s < 10) s = "0" + s;

                var shows = "现在时间是: <span>" + year + "-" + month + "-" + day + " " + h + ":" + mins + ":" + s + " " +             w_array[week] + "</span>";
                document.getElementById("date").innerHTML = shows;
                setTimeout("getdates()",1000);
            }

  • 相关阅读:
    day13
    day11作业
    day12
    小结2
    iOS-常见问题
    iOS-ASIHTTPRequest缓存机制
    iOS-文件断点续传
    iOS-Http : GET : POST
    iOS-通信录
    iOS-汉字排序
  • 原文地址:https://www.cnblogs.com/wangtiantian/p/4987377.html
Copyright © 2020-2023  润新知