Lunar.Pas:
This is a Unit where the national calendar and the lunar calendar alternate between each other.
The years are all in the year of the Republic of China, please convert by yourself (Year 1911 = Year of the Republic of China).
*Explanation of the Chinese Lunar Calendar Correspondence Table: *
* The first two digits = leap month, if it is 13, there is no leap month*
* The third to sixth digits = the binary code of the size of the 12 months -> the decimal*
* For example: *
* 101010101010 = 2730 *
* 1: represents the big month (30 days) 0: represents the small month (29 days) ==> 1 month old, 2 months small, 3 months old... *
*The seventh digit is the number of days in the leap month*
* 0: Number of days without leap month*
* 1: A leap month is a small month (29 days) *
*2: Leap month is a big month (30 days) *
*The last two digits represent the number of days difference between January 1st of the solar calendar and January 1st of the lunar calendar*
*************************************************** *****
This mapping table only covers the first year of the Republic of China to the first year of the Republic of China. If it is not enough for your use, please add it by yourself according to the above method. :)
This program does not determine whether the year, month, and day you entered are correct. Please make your own judgment. :(
If the converted lunar month is a leap month, the value passed to you will be a ***negative number***
If you want to convert the lunar calendar to the national calendar, if it is a leap month, please enter a ***negative number***
This version is FreeWare Version: 0.1
You can modify it yourself, but it is best to email me a copy of the modified program.
If you want to use it for commercial purposes, please email me to tell me your purpose and reason.
Author: Peng Hongjie E-Mail: [email protected]
//Convert from national calendar to lunar calendar (republic of China year, month, day, var lunar year, lunar month, lunar day)
procedure Solar2Lunar(SYear, SMonth, SDay : Integer; Var LYear, LMonth, LDay : Integer);
//Convert from lunar calendar to national calendar (lunar year, lunar month, lunar day, var Republic of China year, month, day)
procedure Lunar2Solar(LYear, LMonth, LDay : Integer; Var SYear, SMonth, SDay : Integer);
//Enter the lunar year to convert the sixty-year name
function YearName(LYear : integer) : string;
//Get the number of days in the lunar month
function DaysPerLunarMonth(LYear, LMonth : Integer) : Integer;
cal.Pas :
A monthly calendar that combines the national calendar and the lunar calendar into one. (Does not require the Delpi 3.0 Chinese application component)
(Range: 1st year of the Republic of China to 100th year of the Republic of China)
New Property:
LYear: Lunar calendar year of the Republic of China LMonth: Lunar calendar month (negative numbers are leap months)
LDay: The number of days in the lunar calendar LYearName: The name of the sixty-year period in the lunar calendar (readonly)
Author: Peng Hongjie E-Mail: [email protected]
This version is FreeWare and can be distributed freely, but try to maintain its integrity. If there are any bugs, please email me.
If you want to make changes, please email me a copy. OK! :)