📄 td.h
字号:
//#include "General.h"
/*typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned int UINT32;*/
typedef struct
{
unsigned char month;
unsigned char day;
char text[10];
} HOLIDAY;
typedef struct
{
unsigned char year;//the year for lunar month
unsigned char month;//the lunar month
unsigned char day;//the first day for solar period
unsigned char lmonth;//the last day for solar period
} LUNAR_TYPEEx;
typedef struct
{
unsigned char day;//the day for lunar month
unsigned char lmonth;//the lunar month
unsigned char fsday;//the first day for solar period?
unsigned char lsday;//the last day for solar period?
} LUNAR_TYPE;
static const unsigned char FirstDay[]=
{
/*
each line shows different year's data
jan. 1 for lunar day;Febr.1 for lunar day and so on
*/
//1980
14,15,15,16,17,19,19,21,22,31,24,24,
26,27,25,27,27,29,30,2,4,4,5,6,
7,8,6,8,8,10,11,12,14,15,16,17,
18,19,17,18,19,20,21,23,24,25,27,27,
29,30,29,1,1,2,3,5,6,7,9,9,
//1985
11,12,10,12,12,13,14,15,17,17,19,20,
21,23,21,23,23,24,25,26,27,28,29,30,
2,4,2,4,4,6,6,7,9,9,10,11,
12,14,14,15,16,17,18,19,21,21,22,23,
24,25,24,25,26,28,29,30,2,2,4,4,
//1990
5,6,5,6,7,9,9,11,13,13,15,15,
16,17,15,17,17,19,20,21,23,24,25,26,
27,28,27,29,29,1,2,3,5,6,7,8,
9,10,9,10,10,12,12,14,15,16,18,18,
20,21,20,21,21,22,23,24,26,26,28,29,
//1995
1,2,1,2,2,4,4,6,7,7,9,10,
11,13,12,14,14,16,16,17,19,19,21,21,
22,24,23,24,25,26,27,28,30,30,2,2,
3,5,3,5,6,7,8,10,11,11,13,13,
14,16,14,15,16,18,18,20,22,22,24,24,
//2000
25,26,26,27,27,29,30,2,4,4,6,6,
7,9,7,8,9,10,11,12,14,15,16,17,
18,20,18,19,19,21,21,23,24,25,27,27,
29,1,29,30,1,2,2,4,5,6,8,8,
10,11,11,12,13,14,14,16,17,18,19,20,
//2005
21,23,21,23,23,25,25,27,28,28,30,1,
2,4,2,4,4,6,6,8,9,10,11,11,
13,14,12,14,15,16,17,19,20,21,22,22,
23,25,24,25,26,28,28,1,2,3,4,4,
6,7,5,6,7,9,9,11,13,13,15,15,
//2010
17,18,16,17,18,19,20,21,23,24,25,26,
27,29,27,28,29,30,1,2,4,5,6,7,
8,10,9,11,11,12,13,14,16,16,18,18,
20,21,20,21,22,23,24,25,26,27,28,29,
1,2,1,2,3,4,5,6,8,8,9,10,
//2015
11,13,11,13,13,15,16,17,19,19,20,20,
22,23,23,24,25,26,27,29,1,1,2,3,
4,5,4,5,6,7,8,10,11,12,13,14,
15,16,14,16,16,18,18,20,22,22,24,24,
26,27,25,27,27,28,29,1,3,3,5,6,
//2020
7,8,8,9,9,10,11,12,14,15,16,17,
18,20,18,20,20,21,22,23,25,25,27,27,
29,1,29,1,1,3,3,4,6,6,8,8,
10,11,10,11,12,14,14,15,17,17,18,19,
20,22,21,23,23,25,26,27,29,29,1,1,
//2025
2,4,2,4,4,6,7,8,10,10,12,12,
13,14,13,14,14,16,17,19,20,21,23,23,
24,25,24,25,25,27,27,29,1,2,4,4,
5,7,6,7,7,9,9,11,13,13,15,16,
17,18,17,18,18,20,20,22,23,24,25,26,
//2030
28,29,28,29,29,1,1,3,4,5,6,7,
8,10,9,10,10,12,12,14,15,15,17,17
};
//all day the second lunar month changes ;example:2000.7.31 begins lunar month July//
static const LUNAR_TYPEEx LunarIndexEx[30]=
{
{81,7,31,7},{84,5,31,5},{86,12,31,12},{89,8,31,8},
{92,6,30,6},{95,1,31,1},{95,3,31,3},{97,10,31,10},
{0,7,31,7},{3,5,31,5},{5,12,31,12},{8,8,31,8},
{11,7,31,7},{14,1,31,1},{14,3,31,3},{16,10,31,10},
{19,8,30,8},{22,5,30,5},{24,12,31,12},{27,9,30,9},
{30,7,30,7}
};
//twelve months's date for each year//
//example:{Jan.7 begins lunar month Dec.;this moth's first and second solar term,s day}//
static const LUNAR_TYPE LunarIndex[] =
{
//1980
{18,12,6,21},{16,1,5,19},{17,2,5,20},{15,3,4,20},
{14,4,5,21},{13,5,5,21},{12,6,7,23},{11,7,7,23},
{9,8,7,23},{9,9,8,23},{8,10,7,22},{7,11,7,22},
//1981
{6,12,5,20},{5,1,4,19},{6,2,6,21},{5,3,5,20},
{4,4,5,21},{2,5,6,21},{2,6,7,23},{29,8,7,23},
{28,9,8,23},{28,10,8,23},{26,11,7,22},{26,12,7,22},
//1982
{25,1,6,20},{24,2,4,19},{25,3,6,21},{24,4,5,20},
{23,4,6,2},{21,5,6,22},{21,6,7,23},{19,7,8,23},
{17,8,8,23},{17,9,8,24},{15,10,8,22},{15,11,7,22},
//1983
{14,12,6,20},{13,1,4,19},{15,2,6,2},{13,3,5,20},
{13,4,6,21},{11,5,6,22},{10,6,8,23},{9,7,8,24},
{7,8,8,23},{6,9,9,24},{5,10,8,23},{4,11,8,22},
//1984
{3,12,6,21},{2,1,4,19},{3,2,5,20},{1,3,4,20},
{1,4,5,21},{29,6,5,21},{28,7,7,22},{27,8,7,23},
{25,9,7,23},{24,10,8,23},{23,10,7,22},{22,11,7,22},
//1985
{21,12,5,20},{20,1,4,19},{21,2,5,21},{20,3,5,20},
{20,4,5,21},{18,5,6,21},{18,6,7,23},{16,7,7,23},
{15,8,8,23},{14,9,8,23},{12,10,7,22},{12,11,7,22},
//1986
{10,12,5,20},{9,1,4,19},{10,2,6,21},{9,3,5,20},
{9,4,6,21},{7,5,6,22},{7,6,7,23},{6,7,8,23},
{4,8,8,23},{4,9,8,24},{2,10,8,22},{2,11,7,22},
//1987
{29,1,6,20},{28,2,4,19},{29,3,6,21},{28,4,5,20},
{27,5,6,21},{26,6,6,22},{26,6,7,23},{24,7,8,24},
{23,8,8,23},{23,9,9,24},{21,10,8,23},{21,11,7,22},
//1988
{19,12,6,21},{17,1,4,19},{18,2,5,20},{16,3,4,20},
{16,4,5,21},{14,5,5,21},{14,6,7,22},{12,7,7,23},
{11,8,7,23},{11,9,8,23},{9,10,7,22},{9,11,7,21},
//1989
{8,12,5,20},{6,1,4,19},{8,2,5,20},{6,3,5,20},
{5,4,5,21},{4,5,6,21},{3,6,7,23},{2,7,7,23},
{30,9,7,23},{29,10,8,23},{28,11,7,22},{28,12,7,22},
//1990
{27,1,5,20},{25,2,4,19},{27,3,6,21},{25,4,5,20},
{24,5,6,21},{23,5,6,21},{22,6,7,23},{20,7,8,23},
{19,8,8,23},{18,9,8,24},{17,10,8,22},{17,11,7,22},
//1991
{16,12,6,20},{15,1,4,19},{16,2,6,21},{15,3,5,20},
{14,4,6,21},{12,5,6,22},{12,6,7,23},{10,7,8,23},
{8,8,8,23},{8,9,9,24},{6,10,8,23},{6,11,7,22},
//1992
{5,12,6,21},{4,1,4,19},{4,2,5,20},{3,3,4,20},
{3,4,5,21},{1,5,5,21},{30,7,7,22},{28,8,7,23},
{26,9,7,23},{26,10,8,23},{24,11,7,22},{24,12,7,21},
//1993
{23,1,5,20},{21,2,4,18},{23,3,5,20},{22,3,5,20},
{21,4,5,21},{20,5,6,21},{19,6,7,23},{18,7,7,23},
{16,8,7,23},{15,9,8,23},{14,10,7,22},{13,11,7,22},
//1994
{12,12,5,20},{10,1,4,19},{12,2,6,21},{11,3,5,20},
{11,4,6,21},{9,5,6,21},{9,6,7,23},{7,7,8,23},
{6,8,8,23},{5,9,8,23},{3,10,7,22},{3,11,7,22},
//1995
{1,12,6,20},{0,0,4,19},{1,2,6,21},{30,4,5,20},
{29,5,6,21},{28,6,6,22},{27,7,7,23},{26,8,8,23},
{25,8,8,23},{24,9,9,24},{22,10,8,23},{22,11,7,22},
//1996
{20,12,6,21},{19,1,4,19},{19,2,5,20},{18,3,4,20},
{17,4,5,21},{16,5,5,21},{16,6,7,22},{14,7,7,23},
{13,8,7,23},{12,9,8,23},{11,10,7,22},{11,11,7,21},
//1997
{9,12,5,20},{7,1,4,18},{9,2,5,20},{7,3,5,20},
{7,4,5,21},{5,5,5,21},{5,6,7,23},{3,7,7,23},
{2,8,7,23},{2,9,8,23},{30,11,7,22},{30,12,7,22},
//1998
{28,1,5,20},{27,2,4,19},{28,3,6,21},{26,4,5,20},
{26,5,6,21},{24,5,6,21},{23,6,7,23},{22,7,8,23},
{21,8,8,23},{20,9,8,23},{19,10,7,22},{19,11,7,22},
//1999
{17,12,6,20},{16,1,4,19},{18,2,6,21},{16,3,5,20},
{15,4,6,21},{14,5,6,22},{13,6,7,23},{11,7,8,23},
{10,8,8,23},{9,9,9,24},{8,10,8,23},{8,11,7,22},
//2000
{7,12,6,21},{5,1,4,19},{6,2,5,20},{5,3,4,20},
{4,4,5,21},{2,5,5,21},{2,6,7,22},{29,8,7,23},
{28,9,7,23},{27,10,8,23},{26,11,7,22},{26,12,7,21},
//2001
{24,1,5,20},{23,2,4,18},{25,3,5,20},{23,4,5,20},
{23,4,5,21},{21,5,5,21},{21,6,7,23},{19,7,7,23},
{17,8,7,23},{17,9,8,23},{15,10,7,22},{15,11,7,22},
//2002
{13,12,5,20},{12,1,4,19},{14,2,6,21},{13,3,5,20},
{12,4,6,21},{11,5,6,21},{10,6,7,23},{9,7,8,23},
{7,8,8,23},{6,9,8,23},{5,10,7,22},{4,11,7,22},
//2003
{3,12,6,20},{1,1,4,19},{3,2,6,21},{2,3,5,20},
{1,4,6,21},{30,6,6,22},{29,7,7,23},{28,8,8,23},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -