国产SUV精二区九色_十八禁视频网站在线观看_久久成人国产精品一区二区_国产对白国语对白 国产小男生约熟女视频-青青操国产熟女视频-午夜日韩高清在线观看-91精品网站福利免费

js網頁中顯示時間

2012/7/22 20:56:041150 閱讀

    <script language=”javascript”>
    
    <!–
    
    calendar = new Date();
    day = calendar.getDay();
    month = calendar.getMonth();
    date = calendar.getDate();
    year = calendar.getYear();
    if (year< 100) year = 1900 + year;
    cent = parseInt(year/100);
    g = year % 19;
    k = parseInt((cent – 17)/25);
    i = (cent – parseInt(cent/4) – parseInt((cent – k)/3) + 19*g + 15) % 30;
    i = i – parseInt(i/28)*(1 –parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
    j = (year + parseInt(year/4) + i + 2 – cent + parseInt(cent/4)) % 7;
    l = i – j;
    emonth = 3 + parseInt((l + 40)/44);
    edate = l + 28 – 31*parseInt((emonth/4));
    emonth–;
    var dayname = new Array (“星期日”, “星期一”, “星期二”, “星期三”, “星期四”, “星期五”, “星期六”);
    var monthname =new Array (“1月”,”2月”,”3月”,”4月”,”5月”,”6月”,”7月”,”8月”,”9月”,”10月”,”11月”,”12月”);
    
    document.write(“<font color=000080>”+year +”年”);
    document.write(monthname[month]);
    document.write(date + “日”+” “);
    document.write(dayname[day]+” “+”</font>”);
    //–>
    </script> <script language=”javascript”>
    <!–
    document.write(“<span id=’clock’></span>”);
    var now,hours,minutes,seconds,timeValue;
    function showtime(){
    now = new Date();
    hours = now.getHours();
    minutes = now.getMinutes();
    seconds = now.getSeconds();
    timeValue = (hours >= 12) ? ” 下午 ” : ” 上午 “;
    timeValue += ((hours > 12) ? hours – 12 : hours) + ” 點 “;
    timeValue += ((minutes <10)?”0″:””) + minutes+” 分 “;
    timeValue += ((seconds <10)?”0″:””) + seconds+” 秒 “;
    clock.innerHTML = timeValue;
    setTimeout(“showtime()”,100);
    }
    
    showtime();
    //–>
    </script>
    
    
    顯示結果:2007年12月7日 星期五 上午 9 點 48 分 37 秒 這段代碼對IE完全支持,有些瀏覽器不能正確顯示,替換方法getYear()→getFullYear()

    下一條:div li 文字圖片一行垂直居中

    上一條:marquee詳解

棗莊西橋網絡微信小程序微信小程序

棗莊西橋網絡手機站二維碼掃描手機瀏覽