Authentic calendar (including the lunar calendar) _ time and date

Source: Internet
Author: User
Authentic calendar (including lunar calendar) Calendar (lunar calendar)

<P> <script language = "JavaScript"> <! -- Var bsYear; var bsDate; var bsWeek; var arrLen = 8; // array length var sValue = 0; // The number of seconds in the current year var dayiy = 0; // The Day of the current year var miy = 0; // The subscript var iyear = 0; // The year mark var dayim = 0; // the day of the current month var spd = 86400; // number of seconds per day </P> <P> var year1999 = "30; 29; 29; 30; 29; 29; 30; 29; 29; 30; 30; 29 "; // 354 var year2000 =" 30; 30; 29; 29; 30; 29; 29; 30; 29; 29; 30; 29 "; // 354 var year2001 = "30; 30; 29; 30; 29; 30; 29; 29; 29; 30; 30 "; // 384 var year2002 = "30; 30; 29; 30; 29; 30; 29; 29; 29; 30; 29 "; // 354 var year2003 = "30; 30; 29; 30; 30; 29; 30; 29; 29; 29; 30 "; // 355 var year2004 = "29; 30; 29; 30; 30; 29; 30; 29; 29; 30; 29; 30 "; // 384 var year2005 = "29; 30; 29; 30; 29; 30; 30; 29; 30; 29; 30; 29 "; // 354 var year2006 = "30; 29; 30; 29; 30; 30; 29; 29; 29; 30; 30; 29; 30 "; </P> <P> var month1999 = "August 1,; August 1,; August 1,; August 1,; August 1,; August 1; december "var month2001 =" Lunar January; February; March; April; May; June; July; August; September; October "var month2004 =" November; february; April 1, February; May 1, March; April; May; June; July; August; September; October; November; December "var month2006 =" Lunar January; February; March; April; May; april; April "var Dn =" first day; second day; third day; fourth day; fifth day; sixth day; Seventh Day; eighth day; ninth day; 10th, 11th, 12th, 13th, 14th, 15th, 16th, 17th, 19th, 20th, Region 1, Region 2, Region 3, Region 4, Region 5, Region 6, and Region 7; limit 8; Limit 9; thirty "; </P> <P> var Ys = new Array (arrLen); Ys [0] = 919094400; Ys [1] = 949680000; ys [2] = 980265600; Ys [3] = 1013443200; Ys [4] = 1044028800; Ys [5] = 1074700800; Ys [6] = 1107878400; ys [7] = 1138464000; </P> <P> var Yn = new Array (arrLen); // name of the agricultural calendar year Yn [0] = ""; yn [1] = ""; Yn [2] = ""; Yn [3] = ""; Yn [4] =" "; yn [5] = ""; Yn [6] = ""; Yn [7] = ""; var D = new Date (); var yy = D. getYear (); var mm = D. getMonth () + 1; var dd = D. getDate (); var ww = D. getDay (); if (ww = 0) ww = "Sunday"; if (ww = 1) ww = "Monday"; if (ww = 2) ww = "Tuesday"; if (ww = 3) ww = "Wednesday"; if (ww = 4) ww = "Thursday"; if (ww = 5) ww = "Friday"; if (ww = 6) ww = "Saturday"; ww = ww; var ss = parseInt (D. getTime ()/1000); if (yy <100) yy = "19" + yy; </P> <P> for (I = 0; I = Ys [I]) {iyear = I; sValue = ss-Ys [I]; // The number of seconds in the current year} dayiy = parseInt (sValue/spd) + 1; // The number of days in the current year </P> <P> var dpm = year1999; if (iyear = 1) dpm = year2000; if (iyear = 2) dpm = year2001; if (iyear = 3) dpm = year2002; if (iyear = 4) dpm = year2003; if (iyear = 5) dpm = year2004; if (iyear = 6) dpm = year2005; if (iyear = 7) dpm = year2006; dpm = dpm. split (";"); </P> <P> var Mn = month1999; if (iyear = 2) Mn = month2001; if (iyear = 5) mn = month2004; if (iyear = 7) Mn = month2006; Mn = Mn. split (";"); </P> <P> var Dn = "1st, 2nd, 3rd, 4th, 5th, 6th, 7th, 8th, 9th, 10th, and 11th; 12th; 13th; 14th; 15th; 16th; 17th; 18th; 19th; 20th; Region 1; Region 2; Region 3; region 4; Region 5; Region 6; Region 7; Region 8; 29th; 30th "; Dn = Dn. split (";"); </P> <P> dayim = dayiy; </P> <P> var total = new Array (13 ); total [0] = parseInt (dpm [0]); for (I = 1; I <dpm. length-1; I ++) total [I] = parseInt (dpm [I]) + total [I-1]; for (I = dpm. length-1; I> 0; I --) if (dayim> total [I-1]) {dayim = dayim-total [I-1]; miy = I;} bsWeek = ww; bsDate = yy + "year" + mm + "month"; bsDate2 = dd; bsYear = "" + Yn [iyear]; bsYear2 = Mn [miy] + Dn [dayim-1]; if (ss> = Ys [7] | ss <Ys [0]) bsYear = Yn [7]; function CAL () {document. write ("<table border = '1' cellspacing = '3' width = '000000' bordercolor = '#105 'bgcolor =' # ffff' height = '000000' cellpadding =' 2 '"); document. write ("<tr> <td align = 'center'> <B>" + bsDate + "<br>" + bsDate2 + "<br>"); document. write (bsWeek + "<br>" + "<br> </B>"); document. write (bsYear + "<br>" + bsYear2 + "</td> </tr> </table> ");} // --> script <script language = "javascript"> CAL (); script </P>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.