當前位置:編程學習大全網 - 源碼下載 - php顯示日期,周幾,農歷初幾,什麽節日函數

php顯示日期,周幾,農歷初幾,什麽節日函數

壹般是用js來顯示:?

今天是<script language="javascript">RunGLNL();</script>?

? 2014年12月28日 星期日 農歷冬月初七

<script>function?RunGLNL(){var?e=new?Date,t=new?Array("星期日","星期壹","星期二","星期三","星期四","星期五","星期六"),i=e.getFullYear()+"年"+[e.getMonth()+1]+"月"+e.getDate()+"日";intHours=e.getHours(),intMinutes=e.getMinutes(),intSeconds=e.getSeconds(),0==intHours?(hours="12:",xfile=""):12>intHours?(hours=intHours+":",xfile=""):12==intHours?(hours="12:",xfile=""):(intHours-=12,hours=intHours+":",xfile=""),minutes=10>intMinutes?"0"+intMinutes+":":intMinutes+":",seconds=10>intSeconds?"0"+intSeconds+"?":intSeconds+"?",i=i+"?"+t[e.getDay()];var?i=i+"?"+CnDateofDateStr(e);i+=SolarTerm(e),document.write(i)}function?DaysNumberofDate(e){return?parseInt((Date.parse(e)-Date.parse(e.getFullYear()+"/1/1"))/864e5)+1}function?CnDateofDate(e){var?t,i,a,n,r,o,s,l,d=new?Array(22,42,218,0,131,73,182,5,14,100,187,0,25,178,91,0,135,106,87,4,18,117,43,0,29,182,149,0,138,173,85,2,21,85,170,0,130,85,108,7,13,201,118,0,23,100,183,0,134,228,174,5,17,234,86,0,27,109,42,0,136,90,170,4,20,173,85,0,129,170,213,9,11,82,234,0,22,169,109,0,132,169,93,6,15,212,174,0,26,234,77,0,135,186,85,4),c=new?Array,h=new?Array,u=new?Array,p=e.getFullYear();if(e.getMonth()+1,e.getDate(),100>p&&(p+=1900),1997>p||p>2020)return?0;for(u[0]=d[4*(p-1997)],u[1]=d[4*(p-1997)+1],u[2]=d[4*(p-1997)+2],u[3]=d[4*(p-1997)+3],c[0]=0!=(128&u[0])?12:11,t=127&u[0],n=u[1],n<<=8,n|=u[2],i=u[3],a=15;a>=0;a--)h[15-a]=29,0!=(1<<a&n)&&h[15-a]++,c[15-a]==i?c[15-a+1]=-i:(c[15-a+1]=c[15-a]<0?-c[15-a]+1:c[15-a]+1,c[15-a+1]>12&&(c[15-a+1]=1));if(r=DaysNumberofDate(e)-1,r<=h[0]-t)s=p>1901&&CnDateofDate(new?Date(p-1+"/12/31"))<0?-c[0]:c[0],l=t+r;else{for(o=h[0]-t,a=1;r>o&&o+h[a]<r;)o+=h[a],a++;s=c[a],l=r-o}return?s>0?100*s+l:100*s-l}function?CnYearofDate(e){var?t=e.getFullYear(),i=e.getMonth()+1,a=parseInt(Math.abs(CnDateofDate(e))/100);return?100>t&&(t+=1900),a>i&&t--,t-=1864,CnEra(t)+"年"}function?CnMonthofDate(e){var?t,i=new?Array("零","正","二","三","四","五","六","七","八","九","十","冬","臘");return?t=parseInt(CnDateofDate(e)/100),0>t?"閏"+i[-t]+"月":i[t]+"月"}function?CnDayofDate(e){var?t,i=new?Array("零","初壹","初二","初三","初四","初五","初六","初七","初八","初九","初十","十壹","十二","十三","十四","十五","十六","十七","十八","十九","二十","廿壹","廿二","廿三","廿四","廿五","廿六","廿七","廿八","廿九","三十");return?t=Math.abs(CnDateofDate(e))%100,i[t]}function?DaysNumberofMonth(e){var?t=e.getFullYear();100>t?t+=1900:t;var?i=t;return?t+="/"+(e.getMonth()+1),i+="/"+(e.getMonth()+2),t+="/1",i+="/1",parseInt((Date.parse(i)-Date.parse(t))/864e5)}function?CnEra(e){var?t=new?Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸"),i=new?Array("子","醜","寅","卯","辰","巳","午","未","申","酉","戌","亥");return?t[e%10]+i[e%12]}function?CnDateofDateStr(e){return"零月"==CnMonthofDate(e)?" 請調整您的計算機日期!":"農歷"+CnMonthofDate(e)+CnDayofDate(e)}function?SolarTerm(e){var?t=new?Array("小寒","大寒","立春","雨水","驚蟄","春分","清明","谷雨","立夏","小滿","芒種","夏至","小暑","大暑","立秋","處暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"),i=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),a=31556926,n=new?Date(1901);for(n.setTime(94712046e4);e.getFullYear()<n.getFullYear();)n.setTime(n.getTime()-1e3*a);for(;e.getFullYear()>n.getFullYear();)n.setTime(n.getTime()+1e3*a);for(var?r=0;e.getMonth()>n.getMonth();r++)n.setTime(n.getTime()+1e3*i[r]);e.getDate()>n.getDate()&&(n.setTime(n.getTime()+1e3*i[r]),r++),e.getDate()>n.getDate()&&(n.setTime(n.getTime()+1e3*i[r]),23==r?r=0:r++);var?o="";return?e.getDate()==n.getDate()&&(o+="?<i>"+t[r]+"</i>"),o}</script>

  • 上一篇:求通達信軟件指標!如主力乾坤!等!謝謝
  • 下一篇:電影院的IMAX和巨幕廳有什麽區別?
  • copyright 2024編程學習大全網