首页|嵌入式系统|显示技术|模拟IC/电源|元件与制造|其他IC/制程|消费类电子|无线/通信|汽车电子|工业控制|医疗电子|测试测量
首页 > 分享下载 > 常用软件 > 万年历算法及源码

万年历算法及源码

资料介绍
万年历算法及源码

万年历算法

一、 阳历算法

具体算法见函数Void get_solar_day_date(void),这样阳历日历的星期排法就确定了。

表1:


月份 1 2 3 4 5 6 7 8 9 10 11 12 
闰年 31 29 31 30 31 30 31 31 30 31 30 31 
非闰年 31 28 31 30 31 30 31 31 30 31 30 31 

变量定义:
Public:
Unsigned int temp_total_day;
Unsigned char gc_solar_calendar_year;
Unsigned char gc_solar_calendar_month;
Unsigned char gc_solar_calendar_date;
Unsigned char gc_lunar_calendar_year;
Unsigned char gc_lunar_calendar_month;
Unsigned char gc_lunar_calendar_date;
Unsigned char start_day_of_week;
说明:函数get_solar_day_date(void)的输入变量:gc_solar_calendar_year和gc_sol
ar_calendar_month
输出变量:start_day_of_week和temp_total_day
Void get_solar_day_date(void)
{
unsigned char temp01;
/*------
calculate what day is the day of the current month and year. Mon~Sun?---*/
/*条件初始化二次,减少运算数据量. temp_total_day 是int型变量*/
万年历算法及源码
本地下载

评论

EEPW网友· 2010-07-13 08:27:11
ygutyu
student87· 2009-11-23 19:40:25
你好,我是刚学编程
EEPW网友· 2009-04-07 11:16:21
我用了这个:
http://www.200sui.com/bbs/htm_data/178/0903/194.html
很好的万年历源码!