农历数据源码(农历数据库)

今天给各位分享农历数据源码的知识,其中也会对农历数据库进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

求Java万年历源代码!!!

我有个JS的要么?

你可以把他改下我是没时间帮你该哈!!!

!--日期框选择--

var DS_x,DS_y;

function dateSelector() //构造dateSelector对象,用来实现一个日历形式的日期输入框。

{

var myDate=new Date();

this.year=myDate.getFullYear(); //定义year属性,年份,默认值为当前系统年份。

this.month=myDate.getMonth()+1; //定义month属性,月份,默认值为当前系统月份。

this.date=myDate.getDate(); //定义date属性,日,默认值为当前系统的日。

this.inputName=''; //定义inputName属性,即输入框的name,默认值为空。注意:在同一页中出现多个日期输入框,不能有重复的name!

this.display=display; //定义display方法,用来显示日期输入框。

}

function display() //定义dateSelector的display方法,它将实现一个日历形式的日期选择框。

{

var week=new Array('日','一','二','三','四','五','六');

document.write("style type=text/css");

document.write(" .ds_font td,span { font: normal 12px 宋体; color: #000000; }");

document.write(" .ds_border { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }");

document.write(" .ds_border2 { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }");

document.write("/style");

var M=new String(this.month);

var d=new String(this.date);

if(M.length==1d.length==1){

document.write("input style='text-align:center;' id='DS_"+this.inputName+"' name='"+this.inputName+"' value='"+this.year+"-0"+this.month+"-0"+this.date+"' title=双击可进行编缉 ondblclick='this.readOnly=false;this.focus()' onblur='this.readOnly=true' readonly");}

else if(M.length==1d.length==2){

document.write("input style='text-align:center;' id='DS_"+this.inputName+"' name='"+this.inputName+"' value='"+this.year+"-0"+this.month+"-"+this.date+"' title=双击可进行编缉 ondblclick='this.readOnly=false;this.focus()' onblur='this.readOnly=true' readonly");}

else if(M.length==2d.length==1){

document.write("input style='text-align:center;' id='DS_"+this.inputName+"' name='"+this.inputName+"' value='"+this.year+"-"+this.month+"-0"+this.date+"' title=双击可进行编缉 ondblclick='this.readOnly=false;this.focus()' onblur='this.readOnly=true' readonly");}

else if(M.length==2d.length==2){

document.write("input style='text-align:center;' id='DS_"+this.inputName+"' name='"+this.inputName+"' value='"+this.year+"-"+this.month+"-"+this.date+"' title=双击可进行编缉 ondblclick='this.readOnly=false;this.focus()' onblur='this.readOnly=true' readonly");}

document.write("button style='width:60px;height:18px;font-size:12px;margin:1px;border:1px solid #A4B3C8;background-color:#DFE7EF;' type=button onclick=this.nextSibling.style.display='block' onfocus=this.blur()日期/button");

document.write("div style='position:absolute;display:none;text-align:center;width:0px;height:0px;overflow:visible' onselectstart='return false;'");

document.write(" div style='position:absolute;left:-60px;top:20px;width:142px;height:165px;background-color:#F6F6F6;border:1px solid #245B7D;' class=ds_font");

document.write(" table cellpadding=0 cellspacing=1 width=140 height=20 bgcolor=#CEDAE7 onmousedown='DS_x=event.x-parentNode.style.pixelLeft;DS_y=event.y-parentNode.style.pixelTop;setCapture();' onmouseup='releaseCapture();' onmousemove='dsMove(this.parentNode)' style='cursor:move;'");

document.write(" tr align=center");

document.write(" td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=subYear(this) title='减小年份'/td");

document.write(" td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=subMonth(this) title='减小月份'/td");

document.write(" td width=52%b"+this.year+"/bb年/bb"+this.month+"/bb月/b/td");

document.write(" td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=addMonth(this) title='增加月份'/td");

document.write(" td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=addYear(this) title='增加年份'/td");

document.write(" /tr");

document.write(" /table");

document.write(" table cellpadding=0 cellspacing=0 width=140 height=20 onmousedown='DS_x=event.x-parentNode.style.pixelLeft;DS_y=event.y-parentNode.style.pixelTop;setCapture();' onmouseup='releaseCapture();' onmousemove='dsMove(this.parentNode)' style='cursor:move;'");

document.write(" tr align=center");

for(i=0;i7;i++)

document.write(" td"+week[i]+"/td");

document.write(" /tr");

document.write(" /table");

document.write(" table cellpadding=0 cellspacing=2 width=140 bgcolor=#EEEEEE");

for(i=0;i6;i++)

{

document.write(" tr align=center");

for(j=0;j7;j++)

document.write(" td width=10% height=16 onmouseover=if(this.innerText!=''this.className!='ds_border2')this.className='ds_border' onmouseout=if(this.className!='ds_border2')this.className='' onclick=getValue(this,document.all('DS_"+this.inputName+"'))/td");

document.write(" /tr");

}

document.write(" /table");

document.write(" span style=cursor:hand onclick=this.parentNode.parentNode.style.display='none'【关闭】/span");

document.write(" /div");

document.write("/div");

dateShow(document.all("DS_"+this.inputName).nextSibling.nextSibling.childNodes[0].childNodes[2],this.year,this.month)

}

function subYear(obj) //减小年份

{

var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;

myObj[0].innerHTML=eval(myObj[0].innerHTML)-1;

dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))

}

function addYear(obj) //增加年份

{

var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;

myObj[0].innerHTML=eval(myObj[0].innerHTML)+1;

dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))

}

function subMonth(obj) //减小月份

{

var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;

var month=eval(myObj[2].innerHTML)-1;

if(month==0)

{

month=12;

subYear(obj);

}

myObj[2].innerHTML=month;

dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))

}

function addMonth(obj) //增加月份

{

var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;

var month=eval(myObj[2].innerHTML)+1;

if(month==13)

{

month=1;

addYear(obj);

}

myObj[2].innerHTML=month;

dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))

}

function dateShow(obj,year,month) //显示各月份的日

{

var myDate=new Date(year,month-1,1);

var today=new Date();

var day=myDate.getDay();

var selectDate=obj.parentNode.parentNode.previousSibling.previousSibling.value.split('-');

var length;

switch(month)

{

case 1:

case 3:

case 5:

case 7:

case 8:

case 10:

case 12:

length=31;

break;

case 4:

case 6:

case 9:

case 11:

length=30;

break;

case 2:

if((year%4==0)(year%100!=0)||(year%400==0))

length=29;

else

length=28;

}

for(i=0;iobj.cells.length;i++)

{

obj.cells[i].innerHTML='';

obj.cells[i].style.color='';

obj.cells[i].className='';

}

for(i=0;ilength;i++)

{

obj.cells[i+day].innerHTML=(i+1);

if(year==today.getFullYear()(month-1)==today.getMonth()(i+1)==today.getDate())

obj.cells[i+day].style.color='red';

if(year==eval(selectDate[0])month==eval(selectDate[1])(i+1)==eval(selectDate[2]))

obj.cells[i+day].className='ds_border2';

}

}

function getValue(obj,inputObj) //把选择的日期传给输入框

{

var myObj=inputObj.nextSibling.nextSibling.childNodes[0].childNodes[0].cells[2].childNodes;

if(obj.innerHTML)

if(obj.innerHTML.length==1myObj[2].innerHTML.length==1)

inputObj.value=myObj[0].innerHTML+"-0"+myObj[2].innerHTML+"-0"+obj.innerHTML;

else if(obj.innerHTML.length==1myObj[2].innerHTML.length==2)

inputObj.value=myObj[0].innerHTML+"-"+myObj[2].innerHTML+"-0"+obj.innerHTML;

else if(obj.innerHTML.length==2myObj[2].innerHTML.length==1)

inputObj.value=myObj[0].innerHTML+"-0"+myObj[2].innerHTML+"-"+obj.innerHTML;

else if(obj.innerHTML.length==2myObj[2].innerHTML.length==2)

inputObj.value=myObj[0].innerHTML+"-"+myObj[2].innerHTML+"-"+obj.innerHTML;

inputObj.nextSibling.nextSibling.style.display='none';

for(i=0;iobj.parentNode.parentNode.parentNode.cells.length;i++)

obj.parentNode.parentNode.parentNode.cells[i].className='';

obj.className='ds_border2'

}

function dsMove(obj) //实现层的拖移

{

if(event.button==1)

{

var X=obj.clientLeft;

var Y=obj.clientTop;

obj.style.pixelLeft=X+(event.x-DS_x);

obj.style.pixelTop=Y+(event.y-DS_y);

}

}

/***调用代码**

script language=javascript

var myDate=new dateSelector();

myDate.year=1900;//morenqiri

myDate.inputName='date'; //

myDate.display();

/script

*/

求一个含农历的万年历系统的c++的源代码

我直接以附件形式放上来了,带农历,带节气,效果蛮好,一个例子是C的,还有个例子是C++的MFC的,这两个例子都在“Code4+提取器”目录下,如果需要控制台程序,直接把C的改一下就可以了,封装成一个农历类。这个类也可以从MFC例子中直接提取。因为有好多个例子源码,就不贴代码,直接上图,工程在附件中(用电脑登录可见),若VS版本低于2008 SP1,请自建工程,然后再添加头文件和源文件。

超全资料,一定要采纳哦。

仅供参考

,提取码:6und

万年历查询程序. C语言代码

除了天数差计算,基本上是完成了你所提出的功能(天数差计算其实已经提供了年内序数计算方方法,可以在此基础上完善即可)。包含星期计算、公历转农历、农历转公历、节气查询。数据与算法均为原创,绝非网上复制而来。附件中有源代码,同时附带农历数据提取工具,可提取1600到7000年之间的任意年份区间,提取后的数据为压缩数据,占用空间小,同时数据包含数九、三伏、入梅和出梅,非常适合写一份完整的万年历。

部分核心算法函数如下:

//判断闰年,参数:年份,返回值:0-平年,1-闰年

int IsLeapYear(int iYear);

//计算日期在年内的序数,参数:年,月,日,年内序数,返回值:0-失败,1-成功

int GetDaysNumInYear(int iYear, int iMonth, int iDay,int *nDays);

//从年内序数计算月、日,参数:年,年内序数,月,日,返回值:0-失败,1-成功

int GetDateFromDays(int iYear, int nDays, int *iMonth, int *iDay);

//检验年、月、日的合法性,参数:年,月,日,返回值:0-失败,1-成功

int DateCheck(int iYear,int iMonth,int iDay);

//获取农历新年的公历年内序数,参数:农历年,返回值:农历新年的公历年内序数

int LunarGetNewYearOrdinal(int iLunarYear);

//获取农历月的天数,参数:农历年,农历月,是否为闰月,返回值:该农历月的天数,为0代表参数无效

int LunarGetDaysofMonth(int iLunarYear,int iLunarMonth,int IsLeapMonth);

//展开大小月数据表(某一年的),参数:农历年,从上一年十一月开始到当前年份(闰)十二月的每月天数,返回值:0-失败,1-成功

int LunarExpandDX(int iLunarYear,int iDayOfMonth[15]);

//获取农历某一年的闰月情况,参数:农历年,返回值,该年的闰月月份,0表示无闰月

int LunarGetLeapMonth(int iLunarYear);

//公历转农历,参数:公历年、月、日,农历年、月、日,是否为闰月,返回值:0-失败,1-成功

int Gongli2Nongli(int iYear,int iMonth,int iDay,int *iLunarYear,int *iLunarMonth,int *iLunarDay,int *iIsLeapMonth);

//农历转公历,参数:家历年、月、日,是否为闰月,公历年、月、日,返回值:0-失败,1-成功

int Nongli2Gongli(int iLunarYear,int iLunarMonth,int iLunarDay,int iIsLeapMonth,int *iYear,int *iMonth,int *iDay);

//得到指定年份的节气信息,首个是小寒

int GetJieQi(int iYear,int uMonth,unsigned int uJieQi[2]);

//计算星期

unsigned int GetDayOfWeek(int iYear,int uMonth,int uDay);

源代码请看

吧。提取码:ooj7

年 月 日 星期 时间 农历 源代码

37021偷来的.下面是一个fun.js文件里的一部分

function show_rili() {

document.write('a href="/mwxq/index-wnl.htm" target="_blank" class=TD1 title="万年历查询"font color="#999999"div class=TD1 id="date"/div/fontfont class=TD1 color="#DF0A10"星期span class=TD1 id="wk"/span/font font color="#999999"span class=TD1 id="clk"/spanbr /font class=TD1农历/fontspan class=TD1 id="nongli"/span/font/a')

cal_u()

cal_s()

setInterval("cal_s()",999)

}

-------------------------------------------------------

下面这段放在主页里调用.别忘了在主页把上面那个文件包含进去

script language=JavaScriptshow_rili()/script

--------------------------------------------------------

包含代码:

SCRIPT language=JavaScript src="/css/fun.js"

type=text/javascript/SCRIPT

求FLASH中文显示农历日期的代码!

flash中有专门的组件用于日历的,你可以试试,设置可以在参数中调。觉得行的话,给我加点分,谢谢

万年历的c语言程序代码包括节假日农历,农历转公历,公历农历查询某

直接给你整个工程吧,实现了星期计算、公历转农历、农历转公历、节气查询。非常不错的代码,你要的年份范围可以自己决定,支持从公元1600年到公元6400年的四千八百年数据。数据经过我精心设计的原创压缩算法压缩,体积非常小,效率很高。

 密码:n51c  (之前的不知啥原因被HX了,原创的都会被这样,鉴于需要的朋友很多,重新更换了链接)。

如果需要开发日历的完整开发包(支持更长年份),可私信。

关于农历数据源码和农历数据库的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。


【免责声明】:

本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。

【关于转载】:

本站尊重互联网版权体系,本站部分图片、文章大部分转载于互联网、所有内容不代表本站观点、不对文章中的任何观点负责、转载的目的只用于给网民提供信息阅读,无任何商业用途,所有内容版权归原作者所有
如本站(文章、内容、图片、视频)任何资料有侵权,先说声抱歉;麻烦您请联系请后台提交工单,我们会立即删除、维护您的权益。非常感谢您的理解。

【附】:

二○○二年一月一日《计算机软件保护条例》第十七条规定:为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬!鉴于此,也希望大家按此说明研究软件!

注:本站资源来自网络转载,版权归原作者和公司所有,如果有侵犯到您的权益,请第一时间联系我们处理!

-----------------------------------------------------------------------------------------------------------

【版权声明】:

一、本站致力于为源码爱好者提供国内外软件开发技术和软件共享,着力为用户提供优资资源。
二、本站提供的源码下载文件为网络共享资源,请于下载后的24小时内删除。如需体验更多乐趣,还请支持正版。
三、如有内容侵犯您的版权或其他利益的,请编辑邮件并加以说明发送到站长邮箱。站长会进行审查之后,情况属实的会在三个工作日内为您删除。
-----------------------------------------------------------------------------------------------------------


内容投诉
源码村资源网 » 农历数据源码(农历数据库)
您需要 登录账户 后才能发表评论

发表评论

欢迎 访客 发表评论