zoukankan      html  css  js  c++  java
  • script实现的日期表示

     function clockon(bgclock){   
    var now=new Date();   
    var year=now.getYear();   
    var month=now.getMonth();   
    var date=now.getDate();   
    var day=now.getDay();   
    var hour=now.getHours();   
    var minu=now.getMinutes();   
    var sec=now.getSeconds();   
    var week;   
    month=month+1;   
    if(month<10) month="0"+month;   
    if(date<10) date="0"+date;   
    if(hour<10) hour="0"+hour;   
    if(minu<10) minu="0"+minu;   
    if(sec<10) sec="0"+sec;   
    switch (day){   
    case 1:   week="星期一";   break;   
    case 2:   week="星期二";   break;   
    case 3:   week="星期三";   break;   
    case 4:   week="星期四";   break;   
    case 5:   week="星期五";   break;   
    case 6:   week="星期六";   break;   
    default:   week="星期日"   break;   
    }   
    var time="";   
    time=year+"年"+month+"月"+date+"日 "+week+" "+hour+":"+minu+":"+sec;   
    if(document.all){   
    bgclock.innerHTML="系统公告:["+time+"]"   
    }   
    var timer=setTimeout("clockon("+ bgclock +")",200);   
    }

    之前所写,迁移至此

    原文链接:http://user.qzone.qq.com/372806800/blog/1336195092

  • 相关阅读:
    基于Metaweblog API 接口一键发布到国内外主流博客平台
    uva144 Student Grants
    Uva 10452
    Uva 439 Knight Moves
    Uva 352 The Seasonal War
    switch语句
    java——基础知识
    我的lua学习2
    codeforces 431 D. Random Task 组合数学
    codeforces 285 D. Permutation Sum 状压 dfs打表
  • 原文地址:https://www.cnblogs.com/amwuau/p/6255406.html
Copyright © 2011-2022 走看看