公曆轉農曆函式

2021-10-10 12:12:32 字數 1072 閱讀 4000

庫名:gton.h

程式by gshuang1(

#ifndef _gton_h__    //防止過載

#define _gton_h__

uchar idata datenong[4]; //

uchar code data1=;

//公曆各個月的天數:

uchar code days_in_a_mon[2][12]=,

};uchar yearstype(uint y)   

void nongli(uint year,uchar mon,uchar day)

days+=day;

for(i=0;i

days1+=dayspring;

if(days==days1)

//春節

else if(days>days1) //當日在春節之後

mon_nong++;

if(mon_nong<5) //1-4月

else if((mon_nong==13)&&(fm==1)) //有閏月的一年的最後乙個月

else if(mon_nong>=5 && mon_nong<13)  //5-12月

}if(fm==1) //其中有閏月,要減去乙個月

datenong[0]=mon_nong/10;

datenong[1]=mon_nong;

datenong[2]=(days+1)/10;

datenong[3]=(days+1);

}else if(days

else

mon_nong--;

if(mon_nong<(5-fm1)) //1-4月

else  //5-12月

}//if(flag1==1) //

if(fm==1) //其中有閏月,要加上乙個月

datenong[0]=mon_nong/10;

datenong[1]=mon_nong;

datenong[2]=(days_nong-days+1)/10;

datenong[3]=(days_nong-days+1);}}

#endif

公曆轉農曆

public string chineselunisolardate datetime adatatime 年月 甲乙丙丁戊己庚辛壬癸 year 4 10 子丑寅卯辰巳午未申酉戌亥 year 4 12 鼠牛虎兔龍蛇馬羊猴雞狗豬 year 4 12 month leapmonth 潤 無正二三四五六七...

c 版公曆轉農曆

using system namespace ljtools private static int year20 new int private static int year19 new int private static int year2000 new int private static ...

C Objective C 公曆轉農曆方法

c 農曆轉換函式 char getdayof psystemtime pst 地支名稱 const char cdizhi 屬相名稱 const char cshuxiang 農曆日期名 const char cdayname 農曆月份名 const char cmonname 公曆每月前面的天數 ...