vb.net农历 vb 农历
VB 农历的计算方法
'下面是一个关于VB的农历算法
十多年的萨尔图网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。全网整合营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整萨尔图建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。成都创新互联公司从事“萨尔图网站设计”,“萨尔图网站推广”以来,每个客户项目都认真落实执行。
'提供基本计算方法,具体应用自己补充
'日期数据定义方法如下
'前12个字节代表1-12月为大月或是小月,1为大月30天,0为小月29天,
'第13位为闰月的情况,1为大月30天,0为小月29天,第14位为闰月的月
'份,如果不是闰月为0,否则给出月份,10、11、12分别用A、B、C来表
'示,即使用16进制。最后4位为当年家农历新年-即农历1月1日所在公历
'的日期,如0131代表1月31日。
'GetYLDate函数使用方式如下tYear为要输入的年,tMonth为月,tDay为
'日期,YLyear是返回值,返加农历的年份,如甲子年,YLShuXing返回
'的是属象,如鼠。IsGetGl是设置是不是通过农历取公历值,如果是,
'前三个返回相应的公历日期,而且返回值是一个公历日期。
Function GetYLDate(tYear As Integer, tMonth As Integer, tDay As Integer, _
YLyear As String, YLShuXing As String, _
Optional IsGetGl As Boolean) As String
On Error Resume Next
Dim daList(1900 To 2011) As String * 18
Dim conDate As Date, setDate As Date
Dim AddMonth As Integer, AddDay As Integer, AddYear As Integer, getDay As Integer
Dim RunYue As Boolean
If tYear 2010 Or tYear 1901 Then Exit Function '如果不是有效有日期,退出
'1900 to 1909
daList(1900) = "010010110110180131"
daList(1901) = "010010101110000219"
daList(1902) = "101001010111000208"
daList(1903) = "010100100110150129"
daList(1904) = "110100100110000216"
daList(1905) = "110110010101000204"
daList(1906) = "011010101010140125"
daList(1907) = "010101101010000213"
daList(1908) = "100110101101000202"
daList(1909) = "010010101110120122"
daList(1910) = "010010101110000210"
daList(1911) = "101001001101160130"
daList(1912) = "101001001101000218"
daList(1913) = "110100100101000206"
daList(1914) = "110101010100150126"
daList(1915) = "101101010101000214"
daList(1916) = "010101101010000204"
daList(1917) = "100101101101020123"
daList(1918) = "100101011011000211"
daList(1919) = "010010011011170201"
daList(1920) = "010010011011000220"
daList(1921) = "101001001011000208"
daList(1922) = "101100100101150128"
daList(1923) = "011010100101000216"
daList(1924) = "011011010100000205"
daList(1925) = "101011011010140124"
daList(1926) = "001010110110000213"
daList(1927) = "100101010111000202"
daList(1928) = "010010010111120123"
daList(1929) = "010010010111000210"
daList(1930) = "011001001011060130"
daList(1931) = "110101001010000217"
daList(1932) = "111010100101000206"
daList(1933) = "011011010100150126"
daList(1934) = "010110101101000214"
daList(1935) = "001010110110000204"
daList(1936) = "100100110111030124"
daList(1937) = "100100101110000211"
daList(1938) = "110010010110170131"
daList(1939) = "110010010101000219"
daList(1940) = "110101001010000208"
daList(1941) = "110110100101060127"
daList(1942) = "101101010101000215"
daList(1943) = "010101101010000205"
daList(1944) = "101010101101140125"
daList(1945) = "001001011101000213"
daList(1946) = "100100101101000202"
daList(1947) = "110010010101120122"
daList(1948) = "101010010101000210"
daList(1949) = "101101001010170129"
daList(1950) = "011011001010000217"
daList(1951) = "101101010101000206"
daList(1952) = "010101011010150127"
daList(1953) = "010011011010000214"
daList(1954) = "101001011011000203"
daList(1955) = "010100101011130124"
daList(1956) = "010100101011000212"
daList(1957) = "101010010101080131"
daList(1958) = "111010010101000218"
daList(1959) = "011010101010000208"
daList(1960) = "101011010101060128"
daList(1961) = "101010110101000215"
daList(1962) = "010010110110000205"
daList(1963) = "101001010111040125"
daList(1964) = "101001010111000213"
daList(1965) = "010100100110000202"
daList(1966) = "111010010011030121"
daList(1967) = "110110010101000209"
daList(1968) = "010110101010170130"
daList(1969) = "010101101010000217"
daList(1970) = "100101101101000206"
daList(1971) = "010010101110150127"
daList(1972) = "010010101101000215"
daList(1973) = "101001001101000203"
daList(1974) = "110100100110140123"
daList(1975) = "110100100101000211"
daList(1976) = "110101010010180131"
daList(1977) = "101101010100000218"
daList(1978) = "101101101010000207"
daList(1979) = "100101101101060128"
daList(1980) = "100101011011000216"
daList(1981) = "010010011011000205"
daList(1982) = "101001001011140125"
daList(1983) = "101001001011000213"
daList(1984) = "1011001001011A0202"
daList(1985) = "011010100101000220"
daList(1986) = "011011010100000209"
daList(1987) = "101011011010060129"
daList(1988) = "101010110110000217"
daList(1989) = "100100110111000206"
daList(1990) = "010010010111150127"
daList(1991) = "010010010111000215"
daList(1992) = "011001001011000204"
daList(1993) = "011010100101030123"
daList(1994) = "111010100101000210"
daList(1995) = "011010110010180131"
daList(1996) = "010110101100000219"
daList(1997) = "101010110110000207"
daList(1998) = "100100110110150128"
daList(1999) = "100100101110000216"
daList(2000) = "110010010110000205"
daList(2001) = "110101001010140124"
daList(2002) = "110101001010000212"
daList(2003) = "110110100101000201"
daList(2004) = "010110101010120122"
daList(2005) = "010101101010000209"
daList(2006) = "101010101101170129"
daList(2007) = "001001011101000218"
daList(2008) = "100100101101000207"
daList(2009) = "110010010101150126"
daList(2010) = "101010010101000214"
daList(2011) = "101101001010000214"
AddYear = tYear
RunYue = False
If IsGetGl Then
AddMonth = Val(Mid(daList(AddYear), 15, 2))
AddDay = Val(Mid(daList(AddYear), 17, 2))
conDate = DateSerial(AddYear, AddMonth, AddDay)
AddDay = tDay
For i = 1 To tMonth - 1
AddDay = AddDay + 29 + Val(Mid(daList(tYear), i, 1))
Next i
'MsgBox DateDiff("d", conDate, Date)
setDate = DateAdd("d", AddDay - 1, conDate)
GetYLDate = setDate
tYear = Year(setDate)
tMonth = Month(setDate)
tDay = Day(setDate)
Exit Function
End If
CHUSHIHUA:
AddMonth = Val(Mid(daList(AddYear), 15, 2))
AddDay = Val(Mid(daList(AddYear), 17, 2))
conDate = DateSerial(AddYear, AddMonth, AddDay)
setDate = DateSerial(tYear, tMonth, tDay)
getDay = DateDiff("d", conDate, setDate)
If getDay 0 Then AddYear = AddYear - 1: GoTo CHUSHIHUA
' addday = NearDay
AddDay = 1: AddMonth = 1
For i = 1 To getDay
AddDay = AddDay + 1
If AddDay = 30 + Mid(daList(AddYear), AddMonth, 1) Or (RunYue And AddDay = 30 + Mid(daList(AddYear), 13, 1)) Then
If RunYue = False And AddMonth = Val("H" Mid(daList(AddYear), 14, 1)) Then
RunYue = True
Else
RunYue = False
AddMonth = AddMonth + 1
End If
AddDay = 1
End If
Next
md$ = "初一初二初三初四初五初六初七初八初九初十十一十二十三十四十五十六十七十八十九二十廿一廿二廿三廿四廿五廿六廿七廿八廿九三十"
dd$ = Mid(md$, (AddDay - 1) * 2 + 1, 2)
mm$ = Mid("正二三四五六七八九十寒腊", AddMonth, 1) + "月"
YouGetDate = DateSerial(AddYear, AddMonth, AddDay)
tiangan$ = "甲乙丙丁戊已庚辛壬癸"
dizhi$ = "子丑寅卯辰巳午未申酉戌亥"
Dim ganzhi(0 To 59) As String * 2
For i = 0 To 59
ganzhi(i) = Mid(tiangan$, (i Mod 10) + 1, 1) + Mid(dizhi$, (i Mod 12) + 1, 1)
'ff$ = ff$ + ganzhi(i)
Next i
'MsgBox ff$, , Len(ff$)
YLyear = ganzhi((AddYear - 4) Mod 60)
shu$ = "鼠牛虎兔龙蛇马羊猴鸡狗猪"
YLShuXing = Mid(shu$, ((AddYear - 4) Mod 12) + 1, 1)
If RunYue Then mm$ = "闰" + mm$
GetYLDate = mm$ + dd$
End Function
'下面是一个使用的例子,你需要在窗体上加上一个按扭,并命名为Command1,然后将下列代码复制到窗体的代码中
Private Sub Command1_Click()
Dim ty As Integer, tm As Integer, td As Integer, yl As String, sx As String
'取公历1999年10月28日的农历日期
ty = 1999
tm = 10
td = 28
t = GetYLDate(ty, tm, td, yl, sx)
MsgBox t
MsgBox ty "-" tm "-" td " " yl " " sx
'取1999年农历十月28的公历日期
t = GetYLDate(ty, tm, td, yl, sx, True)
MsgBox t
MsgBox ty "-" tm "-" td " " yl " " sx
End Sub
"一个关于VB的农历算法-转自CSDN "在Excel如何使用?
Option Explicit
Dim WeekName(7), MonthAdd(11), NongliData(99), TianGan(9), DiZhi(11), ShuXia
ng(11), DayName(30), MonName(12)
Dim curTime, curYear, curMonth, curDay, curWeekday
Dim GongliStr, WeekdayStr, NongliStr, NongliDayStr
Dim i, m, n, k, isEnd, bit, TheDate
Private Sub Form_Load()
'获取当前系统时间
curTime = Now()
'星期名
WeekName(0) = " * "
WeekName(1) = "星期日"
WeekName(2) = "星期一"
WeekName(3) = "星期二"
WeekName(4) = "星期三"
WeekName(5) = "星期四"
WeekName(6) = "星期五"
WeekName(7) = "星期六"
'天干名称
TianGan(0) = "甲"
TianGan(1) = "乙"
TianGan(2) = "丙"
TianGan(3) = "丁"
TianGan(4) = "戊"
TianGan(5) = "己"
TianGan(6) = "庚"
TianGan(7) = "辛"
TianGan(8) = "壬"
TianGan(9) = "癸"
'地支名称
DiZhi(0) = "子"
DiZhi(1) = "丑"
DiZhi(2) = "寅"
DiZhi(3) = "卯"
DiZhi(4) = "辰"
DiZhi(5) = "巳"
DiZhi(6) = "午"
DiZhi(7) = "未"
DiZhi(8) = "申"
DiZhi(9) = "酉"
DiZhi(10) = "戌"
DiZhi(11) = "亥"
'属相名称
ShuXiang(0) = "鼠"
ShuXiang(1) = "牛"
ShuXiang(2) = "虎"
ShuXiang(3) = "兔"
ShuXiang(4) = "龙"
ShuXiang(5) = "蛇"
ShuXiang(6) = "马"
ShuXiang(7) = "羊"
ShuXiang(8) = "猴"
ShuXiang(9) = "鸡"
ShuXiang(10) = "狗"
ShuXiang(11) = "猪"
'农历日期名
DayName(0) = "*"
DayName(1) = "初一"
DayName(2) = "初二"
DayName(3) = "初三"
DayName(4) = "初四"
DayName(5) = "初五"
DayName(6) = "初六"
DayName(7) = "初七"
DayName(8) = "初八"
DayName(9) = "初九"
DayName(10) = "初十"
DayName(11) = "十一"
DayName(12) = "十二"
DayName(13) = "十三"
DayName(14) = "十四"
DayName(15) = "十五"
DayName(16) = "十六"
DayName(17) = "十七"
DayName(18) = "十八"
DayName(19) = "十九"
DayName(20) = "二十"
DayName(21) = "廿一"
DayName(22) = "廿二"
DayName(23) = "廿三"
DayName(24) = "廿四"
DayName(25) = "廿五"
DayName(26) = "廿六"
DayName(27) = "廿七"
DayName(28) = "廿八"
DayName(29) = "廿九"
DayName(30) = "三十"
'农历月份名
MonName(0) = "*"
MonName(1) = "正"
MonName(2) = "二"
MonName(3) = "三"
MonName(4) = "四"
MonName(5) = "五"
MonName(6) = "六"
MonName(7) = "七"
MonName(8) = "八"
MonName(9) = "九"
MonName(10) = "十"
MonName(11) = "十一"
MonName(12) = "腊"
'公历每月前面的天数
MonthAdd(0) = 0
MonthAdd(1) = 31
MonthAdd(2) = 59
MonthAdd(3) = 90
MonthAdd(4) = 120
MonthAdd(5) = 151
MonthAdd(6) = 181
MonthAdd(7) = 212
MonthAdd(8) = 243
MonthAdd(9) = 273
MonthAdd(10) = 304
MonthAdd(11) = 334
'农历数据
NongliData(0) = 2635
NongliData(1) = 333387
NongliData(2) = 1701
NongliData(3) = 1748
NongliData(4) = 267701
NongliData(5) = 694
NongliData(6) = 2391
NongliData(7) = 133423
NongliData(8) = 1175
NongliData(9) = 396438
NongliData(10) = 3402
NongliData(11) = 3749
NongliData(12) = 331177
NongliData(13) = 1453
NongliData(14) = 694
NongliData(15) = 201326
NongliData(16) = 2350
NongliData(17) = 465197
NongliData(18) = 3221
NongliData(19) = 3402
NongliData(20) = 400202
NongliData(21) = 2901
NongliData(22) = 1386
NongliData(23) = 267611
NongliData(24) = 605
NongliData(25) = 2349
NongliData(26) = 137515
NongliData(27) = 2709
NongliData(28) = 464533
NongliData(29) = 1738
NongliData(30) = 2901
NongliData(31) = 330421
NongliData(32) = 1242
NongliData(33) = 2651
NongliData(34) = 199255
NongliData(35) = 1323
NongliData(36) = 529706
NongliData(37) = 3733
NongliData(38) = 1706
NongliData(39) = 398762
NongliData(40) = 2741
NongliData(41) = 1206
NongliData(42) = 267438
NongliData(43) = 2647
NongliData(44) = 1318
NongliData(45) = 204070
NongliData(46) = 3477
NongliData(47) = 461653
NongliData(48) = 1386
NongliData(49) = 2413
NongliData(50) = 330077
NongliData(51) = 1197
NongliData(52) = 2637
NongliData(53) = 268877
NongliData(54) = 3365
NongliData(55) = 531109
NongliData(56) = 2900
NongliData(57) = 2922
NongliData(58) = 398042
NongliData(59) = 2395
NongliData(60) = 1179
NongliData(61) = 267415
NongliData(62) = 2635
NongliData(63) = 661067
NongliData(64) = 1701
NongliData(65) = 1748
NongliData(66) = 398772
NongliData(67) = 2742
NongliData(68) = 2391
NongliData(69) = 330031
NongliData(70) = 1175
NongliData(71) = 1611
NongliData(72) = 200010
NongliData(73) = 3749
NongliData(74) = 527717
NongliData(75) = 1452
NongliData(76) = 2742
NongliData(77) = 332397
NongliData(78) = 2350
NongliData(79) = 3222
NongliData(80) = 268949
NongliData(81) = 3402
NongliData(82) = 3493
NongliData(83) = 133973
NongliData(84) = 1386
NongliData(85) = 464219
NongliData(86) = 605
NongliData(87) = 2349
NongliData(88) = 334123
NongliData(89) = 2709
NongliData(90) = 2890
NongliData(91) = 267946
NongliData(92) = 2773
NongliData(93) = 592565
NongliData(94) = 1210
NongliData(95) = 2651
NongliData(96) = 395863
NongliData(97) = 1323
NongliData(98) = 2707
NongliData(99) = 265877
'生成当前公历年、月、日 == GongliStr
curYear = Year(curTime)
curMonth = Month(curTime)
curDay = Day(curTime)
GongliStr = curYear "年"
If (curMonth 10) Then
GongliStr = GongliStr "0" curMonth "月"
Else
GongliStr = GongliStr curMonth "月"
End If
If (curDay 10) Then
GongliStr = GongliStr "0" curDay "日"
Else
GongliStr = GongliStr curDay "日"
End If
'生成当前公历星期 == WeekdayStr
curWeekday = Weekday(curTime)
WeekdayStr = WeekName(curWeekday)
'计算到初始时间1921年2月8日的天数:1921-2-8(正月初一)
TheDate = (curYear - 1921) * 365 + Int((curYear - 1921) / 4) + curDay + Mont
hAdd(curMonth - 1) - 38
If ((curYear Mod 4) = 0 And curMonth 2) Then
TheDate = TheDate + 1
End If
'计算农历天干、地支、月、日
isEnd = 0
m = 0
Do
If (NongliData(m) 4095) Then
k = 11
Else
k = 12
End If
n = k
Do
If (n 0) Then
Exit Do
End If
'获取NongliData(m)的第n个二进制位的值
bit = NongliData(m)
For i = 1 To n Step 1
bit = Int(bit / 2)
Next
bit = bit Mod 2
If (TheDate = 29 + bit) Then
isEnd = 1
Exit Do
End If
TheDate = TheDate - 29 - bit
n = n - 1
Loop
If (isEnd = 1) Then
Exit Do
End If
m = m + 1
Loop
curYear = 1921 + m
curMonth = k - n + 1
curDay = TheDate
If (k = 12) Then
If (curMonth = (Int(NongliData(m) / 65536) + 1)) Then
curMonth = 1 - curMonth
ElseIf (curMonth (Int(NongliData(m) / 65536) + 1)) Then
curMonth = curMonth - 1
End If
End If
'生成农历天干、地支、属相 == NongliStr
NongliStr = "农历" TianGan(((curYear - 4) Mod 60) Mod 10) DiZhi(((curYea
r - 4) Mod 60) Mod 12) "年"
NongliStr = NongliStr "(" ShuXiang(((curYear - 4) Mod 60) Mod 12) ")"
'生成农历月、日 == NongliDayStr
If (curMonth 1) Then
NongliDayStr = "闰" MonName(-1 * curMonth)
Else
NongliDayStr = MonName(curMonth)
End If
NongliDayStr = NongliDayStr "月"
NongliDayStr = NongliDayStr DayName(curDay)
MsgBox NongliStr NongliDayStr
End Sub
关于24节气时间计算的问题
写不下了
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,//
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x1F,0xF0,0x1F,0xF0,//
0x3F,0xF0,0x0C,0xD0,0x3B,0xF0,0xEC,0x5E,0xCF,0xC0,0x08,0x40,0x0F,0xC0,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0xC0,0x7F,0xF8,0x05,0x40,//
0x06,0xC0,0x3E,0x78,0x0E,0x7C,0x07,0x60,0x8E,0x60,0xFC,0x60,0x70,0x60,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x80,0x08,0xF8,0x2A,0x60,//
0x2B,0xF8,0x1A,0x60,0x1D,0xF0,0x34,0x6E,0x66,0x60,0xC1,0xE0,0x40,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x60,0x3F,0xC0,0x30,0x40,//
0x1F,0xC0,0x10,0x40,0x1F,0xC0,0x10,0x60,0x30,0x30,0x30,0x1C,0x10,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,0xF8,0x30,0x1E,//
0x37,0x94,0x34,0x90,0x37,0x90,0x34,0x90,0x30,0x10,0x1E,0x10,0x0C,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x10,0x7C,0xFF,0x6C,//
0xFF,0xEC,0x11,0x7C,0x13,0x6C,0x10,0x6C,0x10,0x7C,0x1F,0x00,0x0C,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC8,0x78,0x3C,0x30,0x00,//
0x0F,0x00,0x02,0x00,0x06,0x00,0x06,0x00,0x02,0x00,0x03,0x10,0x01,0xE0,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x18,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x20,0x0C,0x1C,0x3F,0xA0,//
0x06,0xB8,0x04,0x1E,0x3F,0x94,0x04,0x10,0x0E,0x10,0xFF,0xD0,0x80,0x30,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xFF,0xFC,0x1F,0xE0,//
0x17,0xE0,0x0B,0x10,0x17,0xF0,0xFB,0x1C,0x1F,0xF0,0x01,0x00,0x01,0xC0,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x30,0x01,0xF0,//
0xFC,0x4C,0x47,0xF8,0x44,0x44,0x44,0xE0,0x7D,0x30,0x02,0x1C,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x31,0xE0,0x1D,0x30,//
0x33,0xC0,0xFC,0x38,0xC3,0x80,0x33,0x70,0x0E,0x00,0x03,0xE0,0x00,0x7C,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0B,0x40,0x13,0x60,//
0x63,0x30,0xDB,0x08,0x0D,0x00,0x06,0x00,0x03,0x80,0x00,0xF0,0x00,0x3C,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x24,0x00,0x24,0x00,0x24,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x02,0x3C,0xFF,0x6C,//
0x04,0xCC,0x3C,0x7C,0x04,0x4C,0x7C,0x6C,0x04,0x7C,0x04,0x00,0x04,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x7F,0xF0,0x04,0x80,//
0x3A,0x60,0x17,0xBC,0x0A,0x2C,0x1E,0x20,0x73,0xA0,0xE0,0xE0,0x00,0x20,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x0B,0x40,//
0x1B,0x60,0x33,0x30,0x63,0x38,0xE3,0x1C,0x43,0x00,0x03,0xE0,0x03,0xC0,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2D,0x30,0x3F,0x30,0x7F,0xFC,//
0x1D,0x30,0x6C,0xF0,0xFF,0xA8,0xD2,0x64,0x0C,0x20,0x37,0x30,0x00,0x20,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x20,0x0F,0xE0,0x0C,0x60,//
0x04,0xE0,0x07,0x00,0x07,0x00,0x1D,0x80,0xF8,0xE0,0xF0,0x3C,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x7F,0xF0,0x01,0x98,//
0x03,0xC0,0x3F,0xE0,0x0A,0x80,0x1A,0xC0,0x32,0x30,0xC3,0xCC,0x03,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x0A,0xA0,//
0x0E,0xE0,0x0B,0xA0,0x09,0x20,0x1A,0xB0,0x3C,0x58,0xF0,0x3E,0x60,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x18,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x20,0x06,0x20,0x7F,0xFC,//
0x0B,0x24,0x09,0x20,0x0E,0xF8,0x0C,0x88,0x34,0xF8,0xE3,0x00,0xC0,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x7F,0xF8,0x6F,0xE8,//
0x63,0x08,0x6F,0xC8,0x6B,0x08,0x7F,0xE8,0x60,0x08,0x7F,0xF8,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x3F,0xF0,0x03,0x00,//
0x07,0x00,0x1B,0x80,0x33,0xC0,0x63,0x70,0xE3,0x1C,0x03,0x00,0x03,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x10,0x7F,0xD0,0x13,0x10,//
0x1D,0x7C,0x13,0x10,0xFF,0xD0,0xDD,0xB8,0x13,0x84,0x3F,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x7F,0xF8,0x60,0x18,//
0x6F,0xD8,0x6C,0x58,0x2C,0x58,0x2F,0xD8,0x20,0x18,0x3F,0xF8,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x60,0x04,0x40,0xFF,0xFC,//
0xD1,0x20,0x1F,0xF0,0x1F,0xF0,0x10,0x20,0x1F,0xE0,0x1F,0xE0,0x10,0x20,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x60,0x3F,0xC0,0x30,0x40,//
0x1F,0xC0,0x10,0x40,0x1F,0xC0,0x10,0x60,0x30,0x30,0x30,0x1C,0x10,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x00,0x7E,0xF8,0x66,0x88,//
0x7E,0xF8,0x66,0x48,0x62,0x48,0x7E,0x78,0x61,0x00,0x61,0xE0,0x60,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x7F,0xF8,//
0x63,0x08,0x63,0x08,0x7F,0xF8,0x03,0x00,0x03,0x00,0x03,0x00,0x01,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x24,0x00,0x24,0x00,0x24,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x3D,0xF8,0x17,0x50,//
0x7D,0xF0,0x7D,0xF0,0x15,0x08,0x3D,0x68,0x7D,0x68,0xE5,0x04,0x06,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x22,0x20,0x32,0x30,0x12,0xFC,//
0x7F,0x30,0x00,0x70,0x7F,0xB8,0x00,0x3C,0xFF,0xB4,0xFF,0xB0,0x00,0x30,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x03,0x00,//
0x03,0x00,0x1F,0xF0,0x13,0x00,0x1B,0x00,0xFF,0xFC,0xF8,0x0C,0x40,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x39,0x78,0xD7,0x90,//
0x91,0xD0,0x91,0x48,0x4F,0x7C,0x4E,0x54,0x26,0x70,0x3B,0x80,0x10,0x80,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x7F,0xF0,0x00,0x20,//
0x32,0x20,0x32,0xE0,0x12,0xB0,0x10,0x98,0x08,0x1E,0xFF,0xE4,0x40,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x40,0x36,0x70,0x06,0x30,//
0x3F,0xAC,0x0A,0x60,0x0A,0x78,0x0B,0x64,0x99,0xA0,0xF0,0x70,0x60,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x7F,0xF0,0x01,0x88,//
0x04,0xC0,0x04,0x60,0x3F,0xF8,0x04,0x6C,0x04,0x60,0xFF,0xE0,0x00,0x60,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x18,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x90,0x3F,0xF0,0x10,0x30,//
0x10,0x20,0x1F,0xE0,0x18,0x20,0x0C,0xC0,0x38,0x70,0xF0,0x1C,0x40,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x08,0x60,0x0F,0xE0,//
0x0F,0xE0,0x7F,0xF8,0x02,0x48,0x0E,0x60,0x07,0xF0,0xFC,0x1E,0x70,0x04,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x60,0x1F,0xF0,//
0x03,0x10,0x1F,0xF0,0x0F,0x80,0x3B,0x60,0xF3,0x1C,0xC3,0x00,0x03,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xFF,0xF8,0x7E,0xA0,//
0x43,0xF8,0x5A,0x88,0x4A,0xE8,0x4B,0x68,0x3C,0xCC,0x66,0x30,0x82,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0xFC,0x7E,0x44,//
0x1B,0x44,0x1B,0xF8,0x0C,0x08,0x1C,0x88,0x36,0x78,0xE3,0xDC,0xC0,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x24,0x00,0x24,0x00,0x24,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x7E,0xB0,0x41,0x20,//
0x40,0xA0,0x5F,0xA0,0x49,0xA0,0x4F,0xB0,0x48,0x98,0x40,0x0C,0x40,0x04,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x1F,0xF8,//
0xF0,0x84,0x1F,0xF0,0x00,0xC0,0x3F,0xE0,0x21,0xBE,0x3F,0x80,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x60,0x3A,0xD0,0x07,0x98,//
0x3E,0x60,0x04,0xF0,0x32,0xF0,0x1E,0x90,0x06,0xF8,0xFC,0x8C,0x60,0x84,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xFF,0xF8,0xE1,0x9C,//
0x10,0xC0,0x1F,0xE0,0x1F,0xBC,0x19,0x80,0x16,0x80,0x10,0xE0,0x10,0x20,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x40,0x07,0xC0,0x04,0x40,//
0x04,0x40,0x04,0x40,0x04,0x60,0x04,0x60,0xFC,0x38,0xF8,0x1C,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x31,0xE0,0x1D,0x30,//
0x33,0xC0,0xFC,0x38,0xC3,0x80,0x33,0x70,0x0E,0x00,0x03,0xE0,0x00,0x7C,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0xF0,0x2E,0x48,0x1F,0xF8,//
0x1D,0x70,0x23,0x48,0x4A,0x34,0x05,0xE4,0x07,0x04,0xFC,0x04,0x60,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x18,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x06,0x70,0x1B,0x74,//
0x71,0xB4,0xEF,0xF4,0x10,0x30,0x3F,0x30,0x31,0x30,0x1F,0x30,0x11,0x10,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x22,0x40,0x36,0x38,0x34,0x9E,//
0x30,0x90,0x10,0x90,0x12,0x90,0x29,0xD0,0xEC,0xD0,0xC6,0x10,0x01,0x10,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0xFF,0xFC,0xF0,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x98,0x04,0x30,//
0x04,0x04,0x04,0x1C,0x04,0x00,0x04,0x20,0xFF,0xD8,0xF0,0x6C,0x00,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x1F,0xF0,0x1F,0xF0,//
0x3F,0xF0,0x0C,0xD0,0x3B,0xF0,0xEC,0x5E,0xCF,0xC0,0x08,0x40,0x0F,0xC0,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x33,0x78,//
0x0F,0xD8,0x0D,0x40,0x39,0x60,0xF1,0x38,0xE1,0x1C,0x01,0xE0,0x01,0x80,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x21,0x80,0x7F,0xF0,//
0x60,0x10,0x6F,0xD0,0x6C,0xD0,0x6C,0x90,0x6F,0x98,0x60,0x0E,0x60,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x7F,0xF0,0x01,0x98,//
0x03,0xC0,0x3F,0xE0,0x0A,0x80,0x1A,0xC0,0x32,0x30,0xC3,0xCC,0x03,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x7F,0x98,0x0A,0x70,//
0x3B,0x84,0x04,0x3C,0x0F,0x00,0x0F,0x20,0x1E,0x9C,0xF6,0xE8,0x40,0x00,0x00,0x00,//
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x20,0x00,0x20,//
0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x20,//
VB.NET的阳历与农历转换的算法
根据经验, 这个算法非常复杂. 经过查找,终于得到一些资料, 在此愿与大家分享。 首先阴历以月为基本单位,一个月以新月出现的那一天为始直至下一个新月出现的前一天。 由于月亮公转的周期介于29到30天之间,阴历的一个月也就由新月出现时刻的早晚或是29天或是30天。 大月为30天,小月为29天。 与阳历不同的是,大小月在不同的年中不固定。 如春节的前一天常称为大年三十,但有不少年如2000年的阴历十二月只有29天。 由于十二个月的时间较阳历年即地球绕太阳公转一周的时间短11天左右. 为了使阴历年与阳历年保持相对稳定,每隔两三年就需要加入一个闰月。 大约每十九年要加入七个闰月。 而二十四节气则是由地球在绕太阳公转的轨道上的位置确定的。 以每年的冬至为始,每15度为一个节气。 是故二十四节气在阳历的每月中有大概固定的日期。 古时以二十四节气指导农耕,这就是阴历又称农历的原因。 其中阳历下半月的十二个节气又称为中气。 中气出现的时刻和闰月的确定有直接的关系。 阴历的计算有下列四条规则: 1.所有新月和节气出现的时刻的计算以东经120度即东八区标准时为准。 但计算1929年以前的阴历时应以北京即东经116度25分的当地时为准。 2.新月出现的一天为一个月的第一天。 如某个节气的出现时刻也在这一天,则不论该节气的出现时刻是否比新月晚,一律算落入新的一个月中。 3.每年的冬至总是落在这年的十一月中。 从一年的冬至的第二天起到下一年冬至这一天止的这段时间称为一岁。 如一岁中有十三个新月出现,则这一岁为闰岁,要加入一个闰月。 4.闰岁中第一个没有中气的月为闰月。 因为一岁中只有十二个中气,所以闰岁中至少有一个月没有中气,也存在有两个月没有中气的可能性。 但这种情况下只有第一个没有中气的月为闰月。 闰月的前一个月为几月则该闰月称为闰几月。 根据以上信息, 我们知道农历是根据天文观测进行指定的(也许可以在天文学的书上找到说明)。 为了简化转换计算, 很多程序人员设计了基于"时间段内查表"方法的例程. 更具体的说明和源码请参考下面这些资料:
vb.net中怎样使DateTimePicker显示该月的阴历
VB或vb.NET或其它语言的控件都无法显示阴历,因为国外不使用阴历,你只能在网上找找第三方控件
网页名称:vb.net农历 vb 农历
标题URL:http://pwwzsj.com/article/hgehch.html