Algorithm of the lunar calendar

zhaozj2021-02-11  188

Latest Description: This article is for others, now I know what users are doing this site!

Dim Weekname (7), MONTHADD (11), Nonglidata (99), Tiangan (9), Dizhi (11), Shuxiang (11), DayName (30), Monname (12) Dim Curtime, Curyear, Curmonth, CurDay, Curweekdaydim Gonglistr, Weekdaystr, Nonglistr, NonglidayStrdim i, M, N, K, Isend, Bit, THEDATE

Private Sub Form_Load () 'Gets the current system time CURTIME = NOW ()

'Week Weekname (0) = "*" Weekname (1) = "Sunday" weekname (2) = "Monday" weekname (3) = "Tuesday" Weekname (4) = "Wednesday" Weekname (5) = " Thursday "Weekname (6) =" Friday "weekname (7) =" Saturday "

'Tiandan name tiangan (0) = "A" tiangan (1) = "" "tiangan (2) =" "tiangan (3) =" Ding "tiangan (4) =" "tiangan (5) =" "Tiangan (6) =" Geng "tiangan (7) =" Xin "tiangan (8) =" "tiangan (9) =" "

'Land name dizhi (0) = "子" dizhi (1) = "ugly" dizhi (2) = "寅" dizhi (3) = "" dizhi (4) = "Chen" dizhi (5) = "=" "Dizhi (6) =" Mid "dizhi (7) =" Not "Dizhi (8) =" Shen "dizhi (9) =" "dizhi (10) =" "dizhi (11) =" Hai "

'Genia name shuxiang (0) = "rat" shuxiang (1) = "cattle" shuxiang (2) = "Tiger" shuxiang (3) = "rabbit" shuxiang (4) = "Dragon" shuxiang (5) = "snake "Shuxiang (6) =" Ma "shuxiang (7) =" Sheep "shuxiang (8) =" Monkey "shuxiang (9) =" Chicken "shuxiang (10) =" Dog "shuxiang (11) =" Pig "

'Lunar New Year name dayName (0) = "*" dayName (1) = "First" dayName (2) = "Junior" DayName (3) = "First Three" DayName (4) = "First Four" DayName 5) = "First Five" DayName (6) = "First Six" DayName (7) = "Chu" DayName (8) = "First Eight" DayName (9) = "Jijiu" DayName (10) = " Ten "DayName (11) =" Ten? Quot; "DAYNAME (12) =" Twelve "daysName (13) =" 13 "DayName (14) =" 14 "DayName (15) =" fifteen "daysname (16) = "sixteen" daysname (17) = "seventeen" daysname (18) = "18" daysname (19) = "19" daysname (20) = "twenty" dayname (21) = "廿 一 "dayname (22) =" 二 "daysname (23) =" 三 "daysname (24) =" 四 "daysname (25) =" 五 "daysname (26) =" 六 "daysname 27) = "廿 7" daysName (28) = "八" daysname (29) = "九" daysname (30) = "thirty" 'Lunar month Monname (0) = "*" Monname (1) = "Positive" Monname (2) = "II" Monname (3) = "Three" Monname (4) = "Four" Monname (5) = "Five" Monname (6) = "Six" Monname (7) = " "Monname (8) =" eight "Monname (9) =" nine "Monname (10) =" 10 "Monname (11) =" 11 "Monname (12) =" La "

'Qual calendar Month, MONTHADD (0) = 0monthadd (1) = 31MONTHADD (2) = 59monthadd (3) = 90monthadd (4) = 120monthadd (5) = 151monthadd (6) = 181Monthadd (7) = 212monthadd (8 ) = 243monthadd (9) = 273monthadd (10) = 304Monthadd (11) = 334

'Lunar data NongliData (0) = 2635NongliData (1) = 333387NongliData (2) = 1701NongliData (3) = 1748NongliData (4) = 267701NongliData (5) = 694NongliData (6) = 2391NongliData (7) = 133423NongliData (8) = 1175NongliData ( 9) = 396438NongliData (10) = 3402NongliData (11) = 3749NongliData (12) = 331177NongliData (13) = 1453NongliData (14) = 694NongliData (15) = 201326NongliData (16) = 2350NongliData (17) = 465197NongliData (18) = 3221NongliData ( 19) = 3402NongliData (20) = 400202NongliData (21) = 2901NongliData (22) = 1386NongliData (23) = 267611NongliData (24) = 605NongliData (25) = 2349NongliData (26) = 137515NongliData (27) = 2709NongliData (28) = 464533NongliData ( 29) = 1738NongliData (30) = 2901NongliData (31) = 330421NongliData (32) = 1242NongliData (33) = 2651NongliData (34) = 199255NongliData (35) = 1323NongliData (36) = 529706NongliData (37) = 3733NongliData (38) = 1706NongliData ( 39) = 398762nonglidata (40) = 2741nonglidata (41) = 1206nonglidata (42) = 267438nonglidata (43) = 2647nonglidata (44) = 1318nonglidata (45) = 204070nonglida ta (46) = 3477NongliData (47) = 461653NongliData (48) = 1386NongliData (49) = 2413NongliData (50) = 330077NongliData (51) = 1197NongliData (52) = 2637NongliData (53) = 268877NongliData (54) = 3365NongliData (55) = 531109NongliData (56) = 2900NongliData (57) = 2922NongliData (58) = 398042NongliData (59) = 2395NongliData (60) = 1179NongliData (61) = 267415NongliData (62) = 2635NongliData (63) = 661067NongliData (64) = 1701NongliData (65) = 1748nonglidata (66) = 398772nonglidata (67) =

2742NongliData (68) = 2391NongliData (69) = 330031NongliData (70) = 1175NongliData (71) = 1611NongliData (72) = 200010NongliData (73) = 3749NongliData (74) = 527717NongliData (75) = 1452NongliData (76) = 2742NongliData (77) = 332397NongliData (78) = 2350NongliData (79) = 3222NongliData (80) = 268949NongliData (81) = 3402NongliData (82) = 3493NongliData (83) = 133973NongliData (84) = 1386NongliData (85) = 464219NongliData (86) = 605NongliData (87) = 2349NongliData (88) = 334123NongliData (89) = 2709NongliData (90) = 2890NongliData (91) = 267946NongliData (92) = 2773NongliData (93) = 592565NongliData (94) = 1210NongliData (95) = 2651NongliData (96) = 395863NongliData (97) = 1323nonglidata (98) = 2707nonglidata (99) = 265877 'Generates Current Question

Gonglistr = Curyear & "New Year" IF (Curmonth <10) Then Gonglistr = Gonglistr & "0" & ​​Curmonth & "Month" Else Gonglistr = Gonglistr & Curmonth & "Month" end ifif (Curday <10) THEN GONGLISTR = GONGLISTR & " 0 "& CURDAY &" Japan "Else Gonglistr = Gonglistr & Curday &" Japan "End IF

'Generate the current question Master Week ==> WeekdaystrCurweekday = weekday (curtime) WeekdayStr = Weekname (curweekday)

'Calculated to the initial time February 8, 1921: 1921-2-8 (Johna) Twate = (Curyear - 1921) * 365 Int (CURYEAR - 1921) / 4) CURDAY MONTHADD (CURMONTH - 1) - 38IF ((Curyear Mod 4) = 0 and curmonth> 2) THEN THEDATE = theseDate 1END IF

'Calculate the lunar calendar, the land, month, day ity = 0m = 0do if (Nonglidata (M) <4095) THEN K = 11 else k = 12 end if

n = k DO if (n <0) THEN EXIT DO END IF

'Get Nonglidata (M) Native Nord Bit = Nonglidata (m) for i = 1 to n Step 1 Bit = Int (bit / 2) Next bit = bit MOD 2

IF (this <= 29 bit) Then Isend = 1 EXIT DO END IF

THEDATE = thesedate - 29 - bit

n = n - 1 loop

IF (isend = 1) THEN EXIT DO END IF

m = m 1LOOP

Curyear = 1921 mcurmonth = K - N 1CURDAY = these

IF (k = 12) THEN IF (curmonth = (INT (Nonglidata (M) / 65536) 1)) THEN CURMONTH = 1 - Curmonth Elseif (Curmonth> (int (Nonglidata (M) / 65536) 1). Curmonth = curmonth - 1 End IF

END IF

'Generate the lunar calendar day, the land, the belonging ==> nonglistrnonglistr = "Lunar calendar" & tiangan ((Curyear - 4) MOD 60) MOD 10) & Dizhi ((Curyear - 4) MOD 60) MOD 12) & "year" Nonglistr = Nonglistr & "(" & SHUXIANG ((Curyear - 4) MOD 60) MOD 12) & ")

'Generate Lunar Month, Japan ==> NonglidayStrif (Curmonth <1) Then Nonglidaystr = "" & Monname (-1 * curmonth) else nonglidaystr = Monname (curmonth) end ifnonglidaystr = NongLidayStr & "Month"

NonglidayStr = Nonglidaystr & dayName (curday)

Msgbox Nonglistr & NonglidayStr

End Sub

转载请注明原文地址:https://www.9cbs.com/read-4851.html

New Post(0)