生活随笔
收集整理的這篇文章主要介紹了
脚本输出当前 “yyyy-MM-dd WeakDay Festval”
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| ylbtech-JavaScript:?腳本輸出當前 “yyyy-MM-dd WeakDay Festval” |
?腳本輸出當前 “yyyy-MM-dd WeakDay Festval”
| 1.A,源代碼(Source Code)-腳本輸出當前 “yyyy-MM-dd WeakDay Festval”返回頂部 |
<SCRIPT language=javascript> <!--calendar = new Date();day = calendar.getDay();month = calendar.getMonth();date = calendar.getDate();year = calendar.getFullYear();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=#000000>" + year + "年");document.write(monthname[month]);document.write(date + "日 ");document.write(dayname[day] + " ");// January(1月份節日,以下同。) if ((month == 0) && (date == 1)) document.write("元旦");if ((month == 4) && (date == 1)) document.write("國際勞動節");if ((month == 5) && (date == 1)) document.write("國際兒童節");if ((month == 9) && (date == 1)) document.write("國慶節");if ((month == 11) && (date == 25)) document.write("圣誕節");document.write("</font>"); //--> </SCRIPT> | | 作者:ylbtech 出處:http://ylbtech.cnblogs.com/ 本文版權歸作者和博客園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接,否則保留追究法律責任的權利。 |
轉載于:https://www.cnblogs.com/ylbtech/archive/2013/03/26/2981911.html
總結
以上是生活随笔為你收集整理的脚本输出当前 “yyyy-MM-dd WeakDay Festval”的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。