搜索
您的当前位置:首页正文

JavaScript转换农历类实现及调用方法_javascript技巧

2023-12-03 来源:亿米科技网

代码如下: var LunarDate = { madd: new Array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334), HsString: '甲乙丙丁戊己庚辛壬癸', EbString: '子丑寅卯辰巳午未申酉戌亥', NumString: "一二三四五六七八九十", MonString: "正二三四五六七八九十冬腊", CalendarData: new Array(0xA4B, 0x5164B, 0x6A5, 0x6D4, 0x415B5, 0x2B6, 0x957, 0x2092F, 0x497, 0x60C96, 0xD4A, 0xEA5, 0x50DA9, 0x5AD, 0x2B6, 0x3126E, 0x92E, 0x7192D, 0xC95, 0xD4A, 0x61B4A, 0xB55, 0x56A, 0x4155B, 0x25D, 0x92D, 0x2192B, 0xA95, 0x71695, 0x6CA, 0xB55, 0x50AB5, 0x4DA, 0xA5B, 0x30A57, 0x52B, 0x8152A, 0xE95, 0x6AA, 0x615AA, 0xAB5, 0x4B6, 0x414AE, 0xA57, 0x526, 0x31D26, 0xD95, 0x70B55, 0x56A, 0x96D, 0x5095D, 0x4AD, 0xA4D, 0x41A4D, 0xD25, 0x81AA5, 0xB54, 0xB6A, 0x612DA, 0x95B, 0x49B, 0x41497, 0xA4B, 0xA164B, 0x6A5, 0x6D4, 0x615B4, 0xAB6, 0x957, 0x5092F, 0x497, 0x64B, 0x30D4A, 0xEA5, 0x80D65, 0x5AC, 0xAB6, 0x5126D, 0x92E, 0xC96, 0x41A95, 0xD4A, 0xDA5, 0x20B55, 0x56A, 0x7155B, 0x25D, 0x92D, 0x5192B, 0xA95, 0xB4A, 0x416AA, 0xAD5, 0x90AB5, 0x4BA, 0xA5B, 0x60A57, 0x52B, 0xA93, 0x40E95), Year: null, Month: null, Day: null, TheDate: null, GetBit: function(m, n){ return (m >> n) & 1; }, e2c: function(){ this.TheDate = (arguments.length != 3) ? new Date(): new Date(arguments[0], arguments[1], arguments[2]); var total, m, n, k; var isEnd = false; var tmp = this.TheDate.getFullYear(); total = (tmp - 1921) * 365 + Math.floor((tmp - 1921) / 4) + this.madd[this.TheDate.getMonth()] + this.TheDate.getDate() - 38; if (this.TheDate.getYear() % 4 == 0 && this.TheDate.getMonth() > 1) { total++; } for (m = 0; ; m++) { k = (this.CalendarData[m] < 0xfff) ? 11: 12; for (n = k; n >= 0; n--) { if (total <= 29 + this.GetBit(this.CalendarData[m], n)) { isEnd = true; break; } total = total - 29 - this.GetBit(this.CalendarData[m], n); } if (isEnd) break; } this.Year = 1921 + m; this.Month = k - n + 1; this.Day = total; if (k == 12) { if (this.Month == Math.floor(this.CalendarData[m] / 0x10000) + 1) { this.Month = 1 - this.Month; } if (this.Month > Math.floor(this.CalendarData[m] / 0x10000) + 1) { this.Month--; } } }, GetcDateString: function(){ var tmp = ""; tmp += this.HsString.charAt((this.Year - 4) % 10); tmp += this.EbString.charAt((this.Year - 4) % 12); tmp += "年 "; if (this.Month < 1) { tmp += "(闰)"; tmp += this.MonString.charAt(-this.Month - 1); } else { tmp += this.MonString.charAt(this.Month - 1); } tmp += "月"; tmp += (this.Day < 11) ? "初": ((this.Day < 20) ? "十": ((this.Day < 30) ? "廿": "三十")); if (this.Day % 10 != 0 || this.Day == 10) { tmp += this.NumString.charAt((this.Day - 1) % 10); } return tmp; }, GetLunarDay: function(solarYear, solarMonth, solarDay) { if (solarYear < 1921 || solarYear > 2020) { return ""; } else { solarMonth = (parseInt(solarMonth) > 0) ? (solarMonth - 1): 11; this.e2c(solarYear, solarMonth, solarDay); return this.GetcDateString(); } } }; 调用方法: 代码如下:LunarDate.GetLunarDay(2013, 1, 24);

小编还为您整理了以下内容,可能对您也有帮助:

javascript阳历转阴历方法?

我这里刚好有这个算法代码,请看:

var LunarDate = {  
madd: new Array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334),  
HsString: '甲乙丙丁戊己庚辛壬癸',  
EbString: '子丑寅卯辰巳午未申酉戌亥',  
NumString: "一二三四五六七*十",  
MonString: "正二三四五六七*十冬腊",  
CalendarData: new Array(0xA4B, 0x5164B, 0x6A5, 0x6D4, 0x415B5, 0x2B6, 0x957, 0x2092F, 0x497, 0x60C96, 0xD4A, 0xEA5, 0x50DA9, 0x5AD, 0x2B6, 0x3126E, 0x92E, 0x7192D, 0xC95, 0xD4A, 0x61B4A, 0xB55, 0x56A, 0x4155B, 0x25D, 0x92D, 0x2192B, 0xA95, 0x71695, 0x6CA, 0xB55, 0x50AB5, 0x4DA, 0xA5B, 0x30A57, 0x52B, 0x8152A, 0xE95, 0x6AA, 0x615AA, 0xAB5, 0x4B6, 0x414AE, 0xA57, 0x526, 0x31D26, 0xD95, 0x70B55, 0x56A, 0x96D, 0x5095D, 0x4AD, 0xA4D, 0x41A4D, 0xD25, 0x81AA5, 0xB54, 0xB6A, 0x612DA, 0x95B, 0x49B, 0x41497, 0xA4B, 0xA164B, 0x6A5, 0x6D4, 0x615B4, 0xAB6, 0x957, 0x5092F, 0x497, 0x64B, 0x30D4A, 0xEA5, 0x80D65, 0x5AC, 0xAB6, 0x5126D, 0x92E, 0xC96, 0x41A95, 0xD4A, 0xDA5, 0x20B55, 0x56A, 0x7155B, 0x25D, 0x92D, 0x5192B, 0xA95, 0xB4A, 0x416AA, 0xAD5, 0x90AB5, 0x4BA, 0xA5B, 0x60A57, 0x52B, 0xA93, 0x40E95),  
Year: null,  
Month: null,  
Day: null,  
TheDate: null,  
GetBit: function(m, n){  
return (m >> n) & 1;  
},  
e2c: function(){  
this.TheDate = (arguments.length != 3) ? new Date(): new Date(arguments[0], arguments[1], arguments[2]);  
var total, m, n, k;  
var isEnd = false;  
var tmp = this.TheDate.getFullYear();  
total = (tmp - 1921) * 365 + Math.floor((tmp - 1921) / 4) + this.madd[this.TheDate.getMonth()] + this.TheDate.getDate() - 38;  
if (this.TheDate.getYear() % 4 == 0 && this.TheDate.getMonth() > 1) {  
total++;  
}  
for (m = 0; ; m++) {  
k = (this.CalendarData[m] < 0xfff) ? 11: 12;  
for (n = k; n >= 0; n--) {  
if (total <= 29 + this.GetBit(this.CalendarData[m], n)) {  
isEnd = true;  
break;  
}  
total = total - 29 - this.GetBit(this.CalendarData[m], n);  
}  
if (isEnd)  
break;  
}  
this.Year = 1921 + m;  
this.Month = k - n + 1;  
this.Day = total;  
if (k == 12) {  
if (this.Month == Math.floor(this.CalendarData[m] / 0x10000) + 1) {  
this.Month = 1 - this.Month;  
}  
if (this.Month > Math.floor(this.CalendarData[m] / 0x10000) + 1) {  
this.Month--;  
}  
}  
},  
GetcDateString: function(){  
var tmp = "";  
tmp += this.HsString.charAt((this.Year - 4) % 10);  
tmp += this.EbString.charAt((this.Year - 4) % 12);  
tmp += "年 ";  
if (this.Month < 1) {  
tmp += "(闰)";  
tmp += this.MonString.charAt(-this.Month - 1);  
} else {  
tmp += this.MonString.charAt(this.Month - 1);  
}  
tmp += "月";  
tmp += (this.Day < 11) ? "初": ((this.Day < 20) ? "十": ((this.Day < 30) ? "廿": "三十"));  
if (this.Day % 10 != 0 || this.Day == 10) {  
tmp += this.NumString.charAt((this.Day - 1) % 10);  
}  
return tmp;  
},  
GetLunarDay: function(solarYear, solarMonth, solarDay) {  
if (solarYear < 1921 || solarYear > 2020) {  
return "";  
} else {  
solarMonth = (parseInt(solarMonth) > 0) ? (solarMonth - 1): 11;  
this.e2c(solarYear, solarMonth, solarDay);  
return this.GetcDateString();  
}  
}  
};

调用代码示例:

window.onload = function(){
document.write('2014-04-01 农历'+LunarDate.GetLunarDay(2014, 4, 1));
};

结果输出:

2014-04-01 农历甲午年 三月初二

javascript阳历转阴历方法?

我这里刚好有这个算法代码,请看:

var LunarDate = {  
madd: new Array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334),  
HsString: '甲乙丙丁戊己庚辛壬癸',  
EbString: '子丑寅卯辰巳午未申酉戌亥',  
NumString: "一二三四五六七*十",  
MonString: "正二三四五六七*十冬腊",  
CalendarData: new Array(0xA4B, 0x5164B, 0x6A5, 0x6D4, 0x415B5, 0x2B6, 0x957, 0x2092F, 0x497, 0x60C96, 0xD4A, 0xEA5, 0x50DA9, 0x5AD, 0x2B6, 0x3126E, 0x92E, 0x7192D, 0xC95, 0xD4A, 0x61B4A, 0xB55, 0x56A, 0x4155B, 0x25D, 0x92D, 0x2192B, 0xA95, 0x71695, 0x6CA, 0xB55, 0x50AB5, 0x4DA, 0xA5B, 0x30A57, 0x52B, 0x8152A, 0xE95, 0x6AA, 0x615AA, 0xAB5, 0x4B6, 0x414AE, 0xA57, 0x526, 0x31D26, 0xD95, 0x70B55, 0x56A, 0x96D, 0x5095D, 0x4AD, 0xA4D, 0x41A4D, 0xD25, 0x81AA5, 0xB54, 0xB6A, 0x612DA, 0x95B, 0x49B, 0x41497, 0xA4B, 0xA164B, 0x6A5, 0x6D4, 0x615B4, 0xAB6, 0x957, 0x5092F, 0x497, 0x64B, 0x30D4A, 0xEA5, 0x80D65, 0x5AC, 0xAB6, 0x5126D, 0x92E, 0xC96, 0x41A95, 0xD4A, 0xDA5, 0x20B55, 0x56A, 0x7155B, 0x25D, 0x92D, 0x5192B, 0xA95, 0xB4A, 0x416AA, 0xAD5, 0x90AB5, 0x4BA, 0xA5B, 0x60A57, 0x52B, 0xA93, 0x40E95),  
Year: null,  
Month: null,  
Day: null,  
TheDate: null,  
GetBit: function(m, n){  
return (m >> n) & 1;  
},  
e2c: function(){  
this.TheDate = (arguments.length != 3) ? new Date(): new Date(arguments[0], arguments[1], arguments[2]);  
var total, m, n, k;  
var isEnd = false;  
var tmp = this.TheDate.getFullYear();  
total = (tmp - 1921) * 365 + Math.floor((tmp - 1921) / 4) + this.madd[this.TheDate.getMonth()] + this.TheDate.getDate() - 38;  
if (this.TheDate.getYear() % 4 == 0 && this.TheDate.getMonth() > 1) {  
total++;  
}  
for (m = 0; ; m++) {  
k = (this.CalendarData[m] < 0xfff) ? 11: 12;  
for (n = k; n >= 0; n--) {  
if (total <= 29 + this.GetBit(this.CalendarData[m], n)) {  
isEnd = true;  
break;  
}  
total = total - 29 - this.GetBit(this.CalendarData[m], n);  
}  
if (isEnd)  
break;  
}  
this.Year = 1921 + m;  
this.Month = k - n + 1;  
this.Day = total;  
if (k == 12) {  
if (this.Month == Math.floor(this.CalendarData[m] / 0x10000) + 1) {  
this.Month = 1 - this.Month;  
}  
if (this.Month > Math.floor(this.CalendarData[m] / 0x10000) + 1) {  
this.Month--;  
}  
}  
},  
GetcDateString: function(){  
var tmp = "";  
tmp += this.HsString.charAt((this.Year - 4) % 10);  
tmp += this.EbString.charAt((this.Year - 4) % 12);  
tmp += "年 ";  
if (this.Month < 1) {  
tmp += "(闰)";  
tmp += this.MonString.charAt(-this.Month - 1);  
} else {  
tmp += this.MonString.charAt(this.Month - 1);  
}  
tmp += "月";  
tmp += (this.Day < 11) ? "初": ((this.Day < 20) ? "十": ((this.Day < 30) ? "廿": "三十"));  
if (this.Day % 10 != 0 || this.Day == 10) {  
tmp += this.NumString.charAt((this.Day - 1) % 10);  
}  
return tmp;  
},  
GetLunarDay: function(solarYear, solarMonth, solarDay) {  
if (solarYear < 1921 || solarYear > 2020) {  
return "";  
} else {  
solarMonth = (parseInt(solarMonth) > 0) ? (solarMonth - 1): 11;  
this.e2c(solarYear, solarMonth, solarDay);  
return this.GetcDateString();  
}  
}  
};

调用代码示例:

window.onload = function(){
document.write('2014-04-01 农历'+LunarDate.GetLunarDay(2014, 4, 1));
};

结果输出:

2014-04-01 农历甲午年 三月初二

高分悬赏--阳历日期转换成阴历日期的算法

<script type="text/javascript">

var CalendarData=new Array(20);

var madd=new Array(12);

var TheDate=new Date();

var tgString="甲乙丙丁戊己庚辛壬癸";

var dzString="子丑寅卯辰巳午未申酉戌亥";

var numString="一二三四五六七十";

var monString="正二三四五六七十冬腊";

var weekString="日一二三四五六";

var sx="鼠牛虎兔龙蛇马羊猴鸡狗猪";

var cYear;

var cMonth;

var cDay;

var cHour;

var cDateString;

var DateString;

var Browser=navigator.appName;

function init()

{

CalendarData[0]=0x41A95;

CalendarData[1]=0xD4A;

CalendarData[2]=0xDA5;

CalendarData[3]=0x20B55;

CalendarData[4]=0x56A;

CalendarData[5]=0x7155B;

CalendarData[6]=0x25D;

CalendarData[7]=0x92D;

CalendarData[8]=0x5192B;

CalendarData[9]=0xA95;

CalendarData[10]=0xB4A;

CalendarData[11]=0x416AA;

CalendarData[12]=0xAD5;

CalendarData[13]=0x90AB5;

CalendarData[14]=0x4BA;

CalendarData[15]=0xA5B;

CalendarData[16]=0x60A57;

CalendarData[17]=0x52B;

CalendarData[18]=0xA93;

CalendarData[19]=0x40E95;

madd[0]=0;

madd[1]=31;

madd[2]=59;

madd[3]=90;

madd[4]=120;

madd[5]=151;

madd[6]=181;

madd[7]=212;

madd[8]=243;

madd[9]=273;

madd[10]=304;

madd[11]=334;

}

function GetBit(m,n)

{

return (m>>n)&1;

}

function e2c()

{

var total,m,n,k;

var isEnd=false;

var tmp=TheDate.getYear();

if (tmp<1900) tmp+=1900;

total=(tmp-2001)*365

+Math.floor((tmp-2001)/4)

+madd[TheDate.getMonth()]

+TheDate.getDate()

-23;

if (TheDate.getYear()%4==0&&TheDate.getMonth()>1)

total++;

for(m=0;;m++)

{

k=(CalendarData[m]<0xfff)?11:12;

for(n=k;n>=0;n--)

{

if(total<=29+GetBit(CalendarData[m],n))

{

isEnd=true;

break;

}

total=total-29-GetBit(CalendarData[m],n);

}

if(isEnd)break;

}

cYear=2001 + m;

cMonth=k-n+1;

cDay=total;

if(k==12)

{

if(cMonth==Math.floor(CalendarData[m]/0x10000)+1)

cMonth=1-cMonth;

if(cMonth>Math.floor(CalendarData[m]/0x10000)+1)

cMonth--;

}

cHour=Math.floor((TheDate.getHours()+3)/2);

}

function GetcDateString()

{

var tmp="";

tmp+=tgString.charAt((cYear-4)%10); //年干

tmp+=dzString.charAt((cYear-4)%12); //年支

tmp+="年(";

tmp+=sx.charAt((cYear-4)%12);

tmp+=")";

if(cMonth<1)

{

tmp+="闰";

tmp+=monString.charAt(-cMonth-1);

}

else

tmp+=monString.charAt(cMonth-1);

tmp+="月";

tmp+=(cDay<11)?"初":((cDay<20)?"十":((cDay<30)?"廿":"卅"));

if(cDay%10!=0||cDay==10)

tmp+=numString.charAt((cDay-1)%10);

if(cHour==13)tmp+="夜";

tmp+=dzString.charAt((cHour-1)%12);

tmp+="时";

cDateString=tmp;

return tmp;

}

function GetDateString()

{

var tmp="";

var t1=TheDate.getYear();

if (t1<1900)t1+=1900;

tmp+=t1

+"-"

+(TheDate.getMonth()+1)+"-"

+TheDate.getDate()+" "

+TheDate.getHours()+":"

+((TheDate.getMinutes()<10)?"0":"")

+TheDate.getMinutes()

+" 星期"+weekString.charAt(TheDate.getDay());

DateString=tmp;

return tmp;

}

init();

e2c();

GetDateString();

GetcDateString();

document.write(DateString,"<br>",cDateString);

</script>

高手帮解决一个JS显示农历时间代码错误问题,真的很谢谢!

function RunGLNL(){
var today=new Date();
var d=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var DDDD=(today.getYear()<100 ?
today.getYear()+1900:today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日";
DDDD = DDDD + " " + d[today.getDay()];
DDDD = DDDD+ " " + (CnDateofDateStr(today));
//DDDD = DDDD+ " " + SolarTerm(today);
document.write(DDDD);
}
function DaysNumberofDate(DateGL){
return parseInt((Date.parse(DateGL)-Date.parse(DateGL.getYear()+"/1/1"))/86400000)+1;
}
function CnDateofDate(DateGL){
var CnData=new Array(
0x16,0x2a,0xda,0x00,0x83,0x49,0xb6,0x05,0x0e,0x64,0xbb,0x00,0x19,0xb2,0x5b,0x00,
0x87,0x6a,0x57,0x04,0x12,0x75,0x2b,0x00,0x1d,0xb6,0x95,0x00,0x8a,0xad,0x55,0x02,
0x15,0x55,0xaa,0x00,0x82,0x55,0x6c,0x07,0x0d,0xc9,0x76,0x00,0x17,0x64,0xb7,0x00,
0x86,0xe4,0xae,0x05,0x11,0xea,0x56,0x00,0x1b,0x6d,0x2a,0x00,0x88,0x5a,0xaa,0x04,
0x14,0xad,0x55,0x00,0x81,0xaa,0xd5,0x09,0x0b,0x52,0xea,0x00,0x16,0xa9,0x6d,0x00,
0x84,0xa9,0x5d,0x06,0x0f,0xd4,0xae,0x00,0x1a,0xea,0x4d,0x00,0x87,0xba,0x55,0x04
);
var CnMonth=new Array();
var CnMonthDays=new Array();
var CnBeginDay;
var LeapMonth;
var Bytes=new Array();
var I;
var CnMonthData;
var DaysCount;
var CnDaysCount;
var ResultMonth;
var ResultDay;
var yyyy=DateGL.getYear();
var mm=DateGL.getMonth()+1;
var dd=DateGL.getDate();
if(yyyy<100) yyyy+=1900;
if ((yyyy < 1997) || (yyyy > 2020)){
return 0;
}
Bytes[0] = CnData[(yyyy - 1997) * 4];
Bytes[1] = CnData[(yyyy - 1997) * 4 + 1];
Bytes[2] = CnData[(yyyy - 1997) * 4 + 2];
Bytes[3] = CnData[(yyyy - 1997) * 4 + 3];
if ((Bytes[0] & 0x80) != 0) {CnMonth[0] = 12;}
else {CnMonth[0] = 11;}
CnBeginDay = (Bytes[0] & 0x7f);
CnMonthData = Bytes[1];
CnMonthData = CnMonthData << 8;
CnMonthData = CnMonthData | Bytes[2];
LeapMonth = Bytes[3];
for (I=15;I>=0;I--){
CnMonthDays[15 - I] = 29;
if (((1 << I) & CnMonthData) != 0 ){
CnMonthDays[15 - I]++;}
if (CnMonth[15 - I] == LeapMonth ){
CnMonth[15 - I + 1] = - LeapMonth;}
else{
if (CnMonth[15 - I] < 0 ){CnMonth[15 - I + 1] = - CnMonth[15 - I] + 1;}
else {CnMonth[15 - I + 1] = CnMonth[15 - I] + 1;}
if (CnMonth[15 - I + 1] > 12 ){ CnMonth[15 - I + 1] = 1;}
}
}
DaysCount = DaysNumberofDate(DateGL) - 1;
if (DaysCount <= (CnMonthDays[0] - CnBeginDay)){
if ((yyyy > 1901) && (CnDateofDate(new Date((yyyy - 1)+"/12/31")) < 0)){
ResultMonth = - CnMonth[0];}
else {ResultMonth = CnMonth[0];}
ResultDay = CnBeginDay + DaysCount;
}
else{
CnDaysCount = CnMonthDays[0] - CnBeginDay;
I = 1;
while ((CnDaysCount < DaysCount) && (CnDaysCount + CnMonthDays[I] < DaysCount)){
CnDaysCount+= CnMonthDays[I];
I++;
}
ResultMonth = CnMonth[I];
ResultDay = DaysCount - CnDaysCount;
}
if (ResultMonth > 0){
return ResultMonth * 100 + ResultDay;}
else{return ResultMonth * 100 - ResultDay;}
}
function CnYearofDate(DateGL){
var YYYY=DateGL.getYear();
var MM=DateGL.getMonth()+1;
var CnMM=parseInt(Math.abs(CnDateofDate(DateGL))/100);
if(YYYY<100) YYYY+=1900;
if(CnMM>MM) YYYY--;
YYYY-=1864;
return CnEra(YYYY)+"年";
}
function CnMonthofDate(DateGL){
var CnMonthStr=new Array("零","正","二","三","四","五","六","七","八","九","十","十一","腊");
var Month;
Month = parseInt(CnDateofDate(DateGL)/100);
if (Month < 0){return "闰" + CnMonthStr[-Month] + "月";}
else{return CnMonthStr[Month] + "月";}
}
function CnDayofDate(DateGL){
var CnDayStr=new Array("零",
"初一", "初二", "初三", "初四", "初五",
"初六", "初七", "初八", "初九", "初十",
"十一", "十二", "十三", "十四", "十五",
"十六", "十七", "十八", "十九", "二十",
"廿一", "廿二", "廿三", "廿四", "廿五",
"廿六", "廿七", "廿八", "廿九", "三十");
var Day;
Day = (Math.abs(CnDateofDate(DateGL)))%100;
return CnDayStr[Day];
}
function DaysNumberofMonth(DateGL){
var MM1=DateGL.getYear();
MM1<100 ? MM1+=1900:MM1;
var MM2=MM1;
MM1+="/"+(DateGL.getMonth()+1);
MM2+="/"+(DateGL.getMonth()+2);
MM1+="/1";
MM2+="/1";
return parseInt((Date.parse(MM2)-Date.parse(MM1))/86400000);
}
function CnEra(YYYY){
var Tiangan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");
//var Di=new Array("子(鼠)","丑(牛)","寅(虎)","卯(兔)","辰(龙)","巳(蛇)",
//"午(马)","未(羊)","申(猴)","酉(鸡)","戌(狗)","亥(猪)");
var Di=new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥");
return Tiangan[YYYY%10]+Di[YYYY%12];
}
function CnDateofDateStr(DateGL){
if(CnMonthofDate(DateGL)=="零月") return " 请调整您的计算机日期!";
else return "农历:"+CnYearofDate(DateGL)+ " " + CnMonthofDate(DateGL) + CnDayofDate(DateGL);
}
function SolarTerm(DateGL){
var SolarTermStr=new Array(
"小寒","大寒","立春","雨水","惊蛰","春分",
"清明","谷雨","立夏","小满","芒种","夏至",
"小暑","大暑","立秋","处暑","白露","秋分",
"寒露","霜降","立冬","小雪","大雪","冬至");
var DifferenceInMonth=new Array(
1272060,1275495,1281180,1289445,1299225,1310355,
1321560,1333035,1342770,1350855,1356420,1359045,
1358580,1355055,1348695,1340040,1329630,1318455,
1306935,1297380,1286865,1277730,1274550,1271556);
var DifferenceInYear=31556926;
var BeginTime=new Date(1901/1/1);
BeginTime.setTime(947120460000);
for(;DateGL.getYear()<BeginTime.getYear();){
BeginTime.setTime(BeginTime.getTime()-DifferenceInYear*1000);
}
for(;DateGL.getYear()>BeginTime.getYear();){
BeginTime.setTime(BeginTime.getTime()+DifferenceInYear*1000);
}
for(var M=0;DateGL.getMonth()>BeginTime.getMonth();M++){
BeginTime.setTime(BeginTime.getTime()+DifferenceInMonth[M]*1000);
}
if(DateGL.getDate()>BeginTime.getDate()){
BeginTime.setTime(BeginTime.getTime()+DifferenceInMonth[M]*1000);
M++;
}
if(DateGL.getDate()>BeginTime.getDate()){
BeginTime.setTime(BeginTime.getTime()+DifferenceInMonth[M]*1000);
M==23?M=0:M++;
}
var JQ;
if(DateGL.getDate()==BeginTime.getDate()){
JQ="  今天是<font color='#FF9999'><b>"+SolarTermStr[M] + "</b></font>";
}
else if(DateGL.getDate()==BeginTime.getDate()-1){
JQ="  明天是<font color='#FF9999'><b>"+SolarTermStr[M] + "</b></font>";
}
else if(DateGL.getDate()==BeginTime.getDate()-2){
JQ="  后天是<font color='#FF9999'><b>"+SolarTermStr[M] + "</b></font>";
}
else{
JQ=" "
if(DateGL.getMonth()==BeginTime.getMonth()){
JQ+="  本月";
}
else{
JQ+="  下月";
}
JQ+=BeginTime.getDate()+"日"+"<font color='#FF9999'><b>"+SolarTermStr[M]+"</b></font>";
}
return JQ;
}
function CAL()
{}
RunGLNL();

高手帮解决一个JS显示农历时间代码错误问题,真的很谢谢!

function RunGLNL(){
var today=new Date();
var d=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var DDDD=(today.getYear()<100 ?
today.getYear()+1900:today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日";
DDDD = DDDD + " " + d[today.getDay()];
DDDD = DDDD+ " " + (CnDateofDateStr(today));
//DDDD = DDDD+ " " + SolarTerm(today);
document.write(DDDD);
}
function DaysNumberofDate(DateGL){
return parseInt((Date.parse(DateGL)-Date.parse(DateGL.getYear()+"/1/1"))/86400000)+1;
}
function CnDateofDate(DateGL){
var CnData=new Array(
0x16,0x2a,0xda,0x00,0x83,0x49,0xb6,0x05,0x0e,0x64,0xbb,0x00,0x19,0xb2,0x5b,0x00,
0x87,0x6a,0x57,0x04,0x12,0x75,0x2b,0x00,0x1d,0xb6,0x95,0x00,0x8a,0xad,0x55,0x02,
0x15,0x55,0xaa,0x00,0x82,0x55,0x6c,0x07,0x0d,0xc9,0x76,0x00,0x17,0x64,0xb7,0x00,
0x86,0xe4,0xae,0x05,0x11,0xea,0x56,0x00,0x1b,0x6d,0x2a,0x00,0x88,0x5a,0xaa,0x04,
0x14,0xad,0x55,0x00,0x81,0xaa,0xd5,0x09,0x0b,0x52,0xea,0x00,0x16,0xa9,0x6d,0x00,
0x84,0xa9,0x5d,0x06,0x0f,0xd4,0xae,0x00,0x1a,0xea,0x4d,0x00,0x87,0xba,0x55,0x04
);
var CnMonth=new Array();
var CnMonthDays=new Array();
var CnBeginDay;
var LeapMonth;
var Bytes=new Array();
var I;
var CnMonthData;
var DaysCount;
var CnDaysCount;
var ResultMonth;
var ResultDay;
var yyyy=DateGL.getYear();
var mm=DateGL.getMonth()+1;
var dd=DateGL.getDate();
if(yyyy<100) yyyy+=1900;
if ((yyyy < 1997) || (yyyy > 2020)){
return 0;
}
Bytes[0] = CnData[(yyyy - 1997) * 4];
Bytes[1] = CnData[(yyyy - 1997) * 4 + 1];
Bytes[2] = CnData[(yyyy - 1997) * 4 + 2];
Bytes[3] = CnData[(yyyy - 1997) * 4 + 3];
if ((Bytes[0] & 0x80) != 0) {CnMonth[0] = 12;}
else {CnMonth[0] = 11;}
CnBeginDay = (Bytes[0] & 0x7f);
CnMonthData = Bytes[1];
CnMonthData = CnMonthData << 8;
CnMonthData = CnMonthData | Bytes[2];
LeapMonth = Bytes[3];
for (I=15;I>=0;I--){
CnMonthDays[15 - I] = 29;
if (((1 << I) & CnMonthData) != 0 ){
CnMonthDays[15 - I]++;}
if (CnMonth[15 - I] == LeapMonth ){
CnMonth[15 - I + 1] = - LeapMonth;}
else{
if (CnMonth[15 - I] < 0 ){CnMonth[15 - I + 1] = - CnMonth[15 - I] + 1;}
else {CnMonth[15 - I + 1] = CnMonth[15 - I] + 1;}
if (CnMonth[15 - I + 1] > 12 ){ CnMonth[15 - I + 1] = 1;}
}
}
DaysCount = DaysNumberofDate(DateGL) - 1;
if (DaysCount <= (CnMonthDays[0] - CnBeginDay)){
if ((yyyy > 1901) && (CnDateofDate(new Date((yyyy - 1)+"/12/31")) < 0)){
ResultMonth = - CnMonth[0];}
else {ResultMonth = CnMonth[0];}
ResultDay = CnBeginDay + DaysCount;
}
else{
CnDaysCount = CnMonthDays[0] - CnBeginDay;
I = 1;
while ((CnDaysCount < DaysCount) && (CnDaysCount + CnMonthDays[I] < DaysCount)){
CnDaysCount+= CnMonthDays[I];
I++;
}
ResultMonth = CnMonth[I];
ResultDay = DaysCount - CnDaysCount;
}
if (ResultMonth > 0){
return ResultMonth * 100 + ResultDay;}
else{return ResultMonth * 100 - ResultDay;}
}
function CnYearofDate(DateGL){
var YYYY=DateGL.getYear();
var MM=DateGL.getMonth()+1;
var CnMM=parseInt(Math.abs(CnDateofDate(DateGL))/100);
if(YYYY<100) YYYY+=1900;
if(CnMM>MM) YYYY--;
YYYY-=1864;
return CnEra(YYYY)+"年";
}
function CnMonthofDate(DateGL){
var CnMonthStr=new Array("零","正","二","三","四","五","六","七","八","九","十","十一","腊");
var Month;
Month = parseInt(CnDateofDate(DateGL)/100);
if (Month < 0){return "闰" + CnMonthStr[-Month] + "月";}
else{return CnMonthStr[Month] + "月";}
}
function CnDayofDate(DateGL){
var CnDayStr=new Array("零",
"初一", "初二", "初三", "初四", "初五",
"初六", "初七", "初八", "初九", "初十",
"十一", "十二", "十三", "十四", "十五",
"十六", "十七", "十八", "十九", "二十",
"廿一", "廿二", "廿三", "廿四", "廿五",
"廿六", "廿七", "廿八", "廿九", "三十");
var Day;
Day = (Math.abs(CnDateofDate(DateGL)))%100;
return CnDayStr[Day];
}
function DaysNumberofMonth(DateGL){
var MM1=DateGL.getYear();
MM1<100 ? MM1+=1900:MM1;
var MM2=MM1;
MM1+="/"+(DateGL.getMonth()+1);
MM2+="/"+(DateGL.getMonth()+2);
MM1+="/1";
MM2+="/1";
return parseInt((Date.parse(MM2)-Date.parse(MM1))/86400000);
}
function CnEra(YYYY){
var Tiangan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");
//var Di=new Array("子(鼠)","丑(牛)","寅(虎)","卯(兔)","辰(龙)","巳(蛇)",
//"午(马)","未(羊)","申(猴)","酉(鸡)","戌(狗)","亥(猪)");
var Di=new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥");
return Tiangan[YYYY%10]+Di[YYYY%12];
}
function CnDateofDateStr(DateGL){
if(CnMonthofDate(DateGL)=="零月") return " 请调整您的计算机日期!";
else return "农历:"+CnYearofDate(DateGL)+ " " + CnMonthofDate(DateGL) + CnDayofDate(DateGL);
}
function SolarTerm(DateGL){
var SolarTermStr=new Array(
"小寒","大寒","立春","雨水","惊蛰","春分",
"清明","谷雨","立夏","小满","芒种","夏至",
"小暑","大暑","立秋","处暑","白露","秋分",
"寒露","霜降","立冬","小雪","大雪","冬至");
var DifferenceInMonth=new Array(
1272060,1275495,1281180,1289445,1299225,1310355,
1321560,1333035,1342770,1350855,1356420,1359045,
1358580,1355055,1348695,1340040,1329630,1318455,
1306935,1297380,1286865,1277730,1274550,1271556);
var DifferenceInYear=31556926;
var BeginTime=new Date(1901/1/1);
BeginTime.setTime(947120460000);
for(;DateGL.getYear()<BeginTime.getYear();){
BeginTime.setTime(BeginTime.getTime()-DifferenceInYear*1000);
}
for(;DateGL.getYear()>BeginTime.getYear();){
BeginTime.setTime(BeginTime.getTime()+DifferenceInYear*1000);
}
for(var M=0;DateGL.getMonth()>BeginTime.getMonth();M++){
BeginTime.setTime(BeginTime.getTime()+DifferenceInMonth[M]*1000);
}
if(DateGL.getDate()>BeginTime.getDate()){
BeginTime.setTime(BeginTime.getTime()+DifferenceInMonth[M]*1000);
M++;
}
if(DateGL.getDate()>BeginTime.getDate()){
BeginTime.setTime(BeginTime.getTime()+DifferenceInMonth[M]*1000);
M==23?M=0:M++;
}
var JQ;
if(DateGL.getDate()==BeginTime.getDate()){
JQ="  今天是<font color='#FF9999'><b>"+SolarTermStr[M] + "</b></font>";
}
else if(DateGL.getDate()==BeginTime.getDate()-1){
JQ="  明天是<font color='#FF9999'><b>"+SolarTermStr[M] + "</b></font>";
}
else if(DateGL.getDate()==BeginTime.getDate()-2){
JQ="  后天是<font color='#FF9999'><b>"+SolarTermStr[M] + "</b></font>";
}
else{
JQ=" "
if(DateGL.getMonth()==BeginTime.getMonth()){
JQ+="  本月";
}
else{
JQ+="  下月";
}
JQ+=BeginTime.getDate()+"日"+"<font color='#FF9999'><b>"+SolarTermStr[M]+"</b></font>";
}
return JQ;
}
function CAL()
{}
RunGLNL();

js如何增加年限if(solarYear<1921 || solarYear>2020){

在页面内用JS操作CSS除非用AJAX,但操作页面内的样式的话,是可以的。操作样式分为改变直接样式,改变className和改变cssText三种
一、局部改变样式
调用方法:
改变className
<div id="demo">测试</div>
<script>
document.getElementById('demo').className="test";
</script>
改变直接样式
<div id="demo">测试</div>
<script>
document.getElementById('obj').style.backgroundColor="#003366";
</script>

二、全局改变样式

可以通过改变外链样式的的href的值实现网页样式的实时切换

<link rel = "stylesheet" type="text/css" id="css" href="firefox.css" />
<span on click="javascript:document.getElementById('css').href = 'ie.css'">点我改变样式</span>

js如何增加年限if(solarYear<1921 || solarYear>2020){

在页面内用JS操作CSS除非用AJAX,但操作页面内的样式的话,是可以的。操作样式分为改变直接样式,改变className和改变cssText三种
一、局部改变样式
调用方法:
改变className
<div id="demo">测试</div>
<script>
document.getElementById('demo').className="test";
</script>
改变直接样式
<div id="demo">测试</div>
<script>
document.getElementById('obj').style.backgroundColor="#003366";
</script>

二、全局改变样式

可以通过改变外链样式的的href的值实现网页样式的实时切换

<link rel = "stylesheet" type="text/css" id="css" href="firefox.css" />
<span on click="javascript:document.getElementById('css').href = 'ie.css'">点我改变样式</span>

有谁知道js的农历算法是怎么写出来的

其实我也不懂这个算法,网上粘贴的,我觉得可以不去深究这个公式,反正有现成代码:

设:公元年数-1977(或1901)=4Q+R
则:阴历日期=14Q+10.6(R+1)+年内日期序数-29.5n
(注:式中Q、R、n均为自然数,R<4)
例:1994年5月7日的阴历日期为:
1994-1977=17=4×4+1
故:Q=4,R=1 则:5月7日的阴历日期为:
14×4+10.6(1+1)+(31+28+31+30+7)-29.5n
=204.2- 29.5n
然后用29.5去除204.2得商数6......27.2,6即是n值,余数27即是阴历二十七日。

有谁知道js的农历算法是怎么写出来的

其实我也不懂这个算法,网上粘贴的,我觉得可以不去深究这个公式,反正有现成代码:

设:公元年数-1977(或1901)=4Q+R
则:阴历日期=14Q+10.6(R+1)+年内日期序数-29.5n
(注:式中Q、R、n均为自然数,R<4)
例:1994年5月7日的阴历日期为:
1994-1977=17=4×4+1
故:Q=4,R=1 则:5月7日的阴历日期为:
14×4+10.6(1+1)+(31+28+31+30+7)-29.5n
=204.2- 29.5n
然后用29.5去除204.2得商数6......27.2,6即是n值,余数27即是阴历二十七日。

JavaScript 中实现继承的方式有哪些?

在JavaScript中,实现继承的方式有以下几种:

1. 原型链继承:通过将子类的原型对象指向父类的实例,从而实现继承。

2. 构造函数继承:在子类的构造函数中调用父类的构造函数,然后返回子类的新实例。

3. 组合继承:结合原型链继承和构造函数继承的优点,通过在子类的原型对象上添加父类的方法来实现继承。

4. 原型式继承:使用Object.create()方法创建一个新对象,并将新对象的原型设置为父类的实例,从而实现继承。这种方法的优点是避免了重复创建属性和方法,但缺点是不支持数组和正则表达式等内置对象的继承。

5. 寄生式继承:在子类原型上添加父类的属性和方法,这样子类可以不直接或间接地访问到父类的属性和方法。这种方式的优点是可以实现完全的封装,但缺点是可能导致代码混乱和难以维护。

怎么调用js文件怎么调用js文件中的方法

如何在python中调用js文件中的方法?

1。打开pycharm开发工具,单击文件菜单,然后选择设置...安装第三方模块;输入selenium并单击InstallPackage。

2.接下来,在python项目的指定文件夹下,右键新建一个python文件,输入文件名,点击Python文件。

3.打开新创建的文件,依次导入selenium、webdriver和time。

4.调用webdriver模块中的Chrome(),使用get()获取对应URL的内容。

5.调用find_element_by_id()获取对应的页面元素,然后调用按钮click事件。

6.在get()方法中修改请求路径,然后保存代码并运行文件检查运行结果。

jsp页面中调用js文件中的方法如何实现?

1、首先要引入js文件2、指定的元素调用js的方法/*下面的例子是JQuery的方法调用each遍历函数,mouseenter函数,find函数*/3、自定义的函数也的调用functionshow1(obj){obj.style.background=red

}varoDiv=$(#p1);oDiv.mouseover=function(){show1(oDiv);}

JS怎么调用PHP中的方法?

在js中调用php的方法是直接在script标签的src属性中嵌入要访问的php地址。

1、JS方式调用PHP文件并取得PHP中的值举例说明:如在页面test_json1中用下面这句调用:scripttype="text/javascript"src="/index.php/test/testjson2">/script>scripttype="text/javascript">alert(jstext);/script>

2、在test_json2.php中有这样一段PHP代码:?php$php_test='IcomefromPHP!';echo"vartest='$php_test';";echo"varjstext="."'$php_test';";?>当执行test_json1.php文件时,就会调用test_json2.php文件,并将b.php文件的输出作为JS语句来执行,所以此处会弹出一个提示框,内容为JS变量jstext的值,也就是在PHP文件中赋给jstext的值。

3、调用结果:

页面内部Js函数如何调用js文件中的函数(以身相许)?

只要在页面的head标签里引用了这个js文件,用scripttype="text/javascript"src="ClientBehavior.js">/script>,然后在页面里的js函数里就可以直接调用js文件中的函数。引用js文件,相当于把这个js文件的函数全部写到该页面中,成为页面里的函数,这样就好理解了

js文件该怎么打开呢?

js文件常见的有两种用法。

1.在网页里使用:一般不能直接打开,只有配合网页使用,如果是想破解某网站的在线电影等,仅从js文件入手可能性不大,建议使用专门的抓取工具,如wpe,抓取网络封包,再对封包分析,js可以使用记事本编辑。

2.在单机使用,一般可以用来做为一个可执行程序直接双击就可以运行,当然前提是计算机没有安装网页设计软件。以js为扩展名的文件是用javascript脚本语言编写的.

JS怎么调用API接口?

需要准备的材料分别是:电脑、html编辑器、浏览器。

1、首先,打开html编辑器,新建html文件,例如:index.html,引入jquery使用。

2、在index.html的

亿米科技网还为您提供以下相关内容希望对您有帮助:

javascript阳历转阴历方法?

(solarMonth - 1): 11; this.e2c(solarYear, solarMonth, solarDay); return this.GetcDateString(); } } };调用代码示例:window.onload = function(){document.write('2014-04-01 农历'+LunarDate.GetLuna...

高分悬赏--阳历日期转换成阴历日期的算法

var CalendarData=new Array(20);var madd=new Array(12);var TheDate=new Date();var tgString="甲乙丙丁戊己庚辛壬癸";var dzString="子丑寅卯辰巳午未申酉戌亥";var numString="一二三四五六七八九十";var ...

农历查询API接口说明

失败情况下一般是参数问题,参数不识别,没有按规则走,格式为yyyy-MM-dd,如2017-02-02。农历查询 JSON返回方式,指定日期 我测试一下请求当天农历查询,链接为: http://www.sojson.com/open/api/lunar/json.shtml?dat...

js如何增加年限if(solarYear&lt;1921 || solarYear&gt;2020){

二、全局改变样式 可以通过改变外链样式的的href的值实现网页样式的实时切换 点我改变样式

高手帮解决一个JS显示农历时间代码错误问题,真的很谢谢!

today.getYear()+1900:today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日";DDDD = DDDD + " " + d[today.getDay()];DDDD = DDDD+ " " + (CnDateofDateStr(today));//DDDD = ...

有谁知道js的农历算法是怎么写出来的

其实我也不懂这个算法,网上粘贴的,我觉得可以不去深究这个公式,反正有现成代码:设:公元年数-1977(或1901)=4Q+R 则:阴历日期=14Q+10.6(R+1)+年内日期序数-29.5n (注:式中Q、R、n均为自然数,R&lt;4)...

JS的类型怎么转换

而在 ES6 中引入 Symbol 类型之后,JavaScript 会优先调用对象的 [Symbol.toPrimitive] 方法来将该对象转化为原始类型,那么方法的调用顺序就变为了: 当obj[Symbol.toPrimitive](preferredType) 方法存在时,优先调用该方法; ...

求单行时间日期html代码,带农历,添加方法

&lt;!-- function CalConv(){ FIRSTYEAR = 1998;LASTYEAR = 2031;today = new Date();SolarYear = today.getFullYear();SolarMonth = today.getMonth() + 1;SolarDate = today.getDate();Weekday = today.get...

求时间日期html代码,带农历!(高手进)

单行带农历的日期时间代码 &lt;SCRIPT language=JavaScript&gt; &lt;!-- function CalConv(){ FIRSTYEAR = 1998;LASTYEAR = 2031;today = new Date();SolarYear = today.getFullYear();SolarMonth = today.getMonth() + 1...

asp插入带农历的日历表或者怎么调用外部js代码或引用以后的一个html_百...

bsYear="农历"+Yn[iyear];bsYear2=Mn[miy]+Dn[dayim-1];if (ss&gt;=Ys[7]||ss &lt;Ys[0]) bsYear=Yn[7];function CAL(){ document.write(" &lt;table border='1' cellspacing='3' width='105' bordercolor='...

本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。

热门图文

  • 蓿的诗有哪些

    1、蓿诗是《苜蓿·花开苜蓿送残春》、《题苜蓿峰寄家人》、《塞上·苜蓿秋高万马肥》、《游仙诗·台观茫茫苜蓿肥》、《怨女曲·空原悲风吹苜蓿》、《渔村杂诗·苜蓿村中卜钓矶》、《戏题·仲父不弃苜蓿盘》、《独骏图·连天苜蓿青茫茫》、《散材·先生苜蓿自阑干》、《同食大麦·大麦新炊苜蓿盘》。2、笔画是14。3、读音是xu。

  • 蓿的诗

    1、蓿诗是《苜蓿·花开苜蓿送残春》、《题苜蓿峰寄家人》、《塞上·苜蓿秋高万马肥》、《游仙诗·台观茫茫苜蓿肥》、《怨女曲·空原悲风吹苜蓿》、《渔村杂诗·苜蓿村中卜钓矶》、《戏题·仲父不弃苜蓿盘》、《独骏图·连天苜蓿青茫茫》、《散材·先生苜蓿自阑干》、《同食大麦·大麦新炊苜蓿盘》。2、笔画是14。3、读音是xu。

  • 蓿字的成语 蓿字的成语有哪些

    1、蓿成语是苜蓿盘空。2、笔画是14。3、读音是xu。4、笔顺是横、竖、竖、点、点、横撇。5、部首是艹。6、结构是上下结构。7、解释是见“苜”。8、组词是苜蓿、南苜蓿、黄花苜蓿、紫花苜蓿、苜蓿盘空。9、诗是《苜蓿·花开苜蓿送残春》、《题苜蓿峰寄家人》、《塞上·苜蓿秋高万马肥》、《游仙诗·台观茫茫苜蓿肥》、《怨女曲·空原悲风吹苜蓿》、《渔村杂诗·苜蓿村中卜钓矶》、《戏题·仲父不弃苜蓿盘》、《独骏图·连天苜蓿青茫茫》、《散材·先生苜蓿自阑干》、《同食大麦·大麦新炊苜蓿盘》。

  • 蓿字的成语有哪些

    1、蓿成语是苜蓿盘空。2、笔画是14。3、读音是xu。4、笔顺是横、竖、竖、点、点、横撇。5、部首是艹。6、结构是上下结构。7、解释是见“苜”。8、组词是苜蓿、南苜蓿、黄花苜蓿、紫花苜蓿、苜蓿盘空。9、诗是《苜蓿·花开苜蓿送残春》、《题苜蓿峰寄家人》、《塞上·苜蓿秋高万马肥》、《游仙诗·台观茫茫苜蓿肥》、《怨女曲·空原悲风吹苜蓿》、《渔村杂诗·苜蓿村中卜钓矶》、《戏题·仲父不弃苜蓿盘》、《独骏图·连天苜蓿青茫茫》、《散材·先生苜蓿自阑干》、《同食大麦·大麦新炊苜蓿盘》。

  • 蓿字的成语

    1、蓿成语是苜蓿盘空。2、笔画是14。3、读音是xu。4、笔顺是横、竖、竖、点、点、横撇。5、部首是艹。6、结构是上下结构。7、解释是见“苜”。8、组词是苜蓿、南苜蓿、黄花苜蓿、紫花苜蓿、苜蓿盘空。9、诗是《苜蓿·花开苜蓿送残春》、《题苜蓿峰寄家人》、《塞上·苜蓿秋高万马肥》、《游仙诗·台观茫茫苜蓿肥》、《怨女曲·空原悲风吹苜蓿》、《渔村杂诗·苜蓿村中卜钓矶》、《戏题·仲父不弃苜蓿盘》、《独骏图·连天苜蓿青茫茫》、《散材·先生苜蓿自阑干》、《同食大麦·大麦新炊苜蓿盘》。

Top