Traditional Culture Encyclopedia - Almanac inquiry - How to make perpetual calendar with VB
How to make perpetual calendar with VB
# Area "Return to Lunar New Year"
Return to the lunar calendar
CCalendar。 Returns the maximum supported date, that is, 2101-kloc-0/-28.
CCalendar。 Returns the minimum supported date, namely 190-2- 19.
Private calendar as a new system ..
The public function pubfun _ cndate (byval s datetime as date) in the form of a string.
CCalendar = new system ..
Dim lyear As Integer = cCalendar。 GetYear(sDateTime)
Dim lmonth As Integer = cCalendar。 GetMonth(sDateTime)
Dim lday As Integer = cCalendar。 (sDateTime)
Dim lweek As Integer = cCalendar。 (sDateTime)
Gets the leap month, where 0 means there is no leap month.
dim leap month As Integer = cCalendar。 (Lill)
Dim isleap As Boolean = False
if(leap month & gt; 0) Then
If(leap month = lmonth) then
leap month—intercalary month in the lunar calendar
isleap = True
lmonth = lmonth - 1
else if(lmonth & gt; Then a month.
lmonth = lmonth - 1
If ... it will be over.
If ... it will be over.
Returns a string. Concat((lYear), IIF(islap = true, "leap year", "year"), (lmonth), "month", (lday))
End function
Ten days' work
Private tiangan As String()= {“A A, B, C, D, E, Ji, Geng, Xin, Man and Ghost}
Twelve earthly branches
Private di As String()= {Zi, Ugly, Yin, Mao, Chen, Si, Wu, Wei, Shen, You, Xu and Hai}.
zodiac
Private Xiao Sheng As String()= {mouse, cow, tiger, freedom, dragon, snake, horse, sheep, monkey, chicken, dog and pig}.
lunar month
Private months As String()= {"Zheng", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven" and "Twelve"}
Lunar calendar day
Privatedays1asstring () = {"Chu", "Ten", "Twenty" and "Three"}
Private days String()= {One, Two, Three, Four, Five, Six, Seven, Eight, Nine and Ten}
Return to the Lunar New Year (heavenly stems and earthly branches Zodiac)
Private function in string form (ByVal year in integer form)
= ""
If (year & gt Then what?
dim tgIndex As Integer =(year-4)Mod 10
dim dz index As Integer =(year-4)Mod 12
Return to Tiangan (tgIndex) and di(dz index) and "["& Xiao Sheng Stock Exchange "]".
If ... it will be over.
Invalid year!
End function
Back to the zodiac
Private function in string form (ByVal sDateTime As Date)
Return to Xiao Sheng (calendar. (cCalendar。 getsexagenary year(sDateTime)- 1)
End function
Return to the lunar month
Private function GetLunisolarMonth in string form (ByVal month in integer form)
GetLunisolarMonth =““
If (0 month), then
Returns the month (month-1)
If ... it will be over.
Invalid month!
End function
Return to Lunar New Year
Private function GetLunisolarDay in string form (ByVal day in integer form)
GetLunisolarDay =““
if(day & gt; 0 and another day
If (20th and 30th days) then
Returns a string. concat(days 1((day- 1)\ 10),days((day- 1)Mod 10)
other
Returns a string. Concat (days ((days-1)\ 10), days 1( 1))
If ... it will be over.
If ... it will be over.
Invalid date!
End function
# End area
- Related articles
- Today is a good day to get married in the solar calendar.
- 【 auspicious day of the zodiac 】 2065438+September 30, 2007?
- Is it the trunk or the fourth branch of the sun column?
- How about picking up the car on April 18, 2022?
- (5.5—5.7) Can you move to a new home in the long summer? The order of moving is particular.
- Have a baby.
- What is the most auspicious day to move in April 2022? Moved into the house in April 2022.
- Guangdong yearbook
- The horoscope of the zodiac and the zodiac.
- How to choose the wedding calendar date? Kneel and beg.