网站在线时间更新

当前时间:<label id="nowdate"></label>

<script>
    function  show_time()
    {
        var today,hour,second,minute,year,month,date,time;

        today=new Date();

        year = today.getFullYear();
        month = today.getMonth()+1;
        date = today.getDate();
        hour = today.getHours();
        minute =today.getMinutes();
        second = today.getSeconds();
        if(minute < 10) minute = '0' + minute;
       if(second < 10) second = '0' + second;
       time = year + "-" + month + "-" + date +" " + hour + ":" + minute + ":" + second;
       $("#nowdate").html(time);
   }
   setInterval(show_time,1000);
 </script>

不停的走动跟表一样

posted on 2014-08-06 21:05  颓废的悠然  阅读(364)  评论(0编辑  收藏  举报

导航