纯asp版带农历日历。谁有好的农历节气算法?
正在写个带农历的asp日历 http://www.linshao.cn/web/date.asp (我用的不是utf-8,直接点击可能会出现乱码)
对于节气的算法不是很明白?
谁能帮忙解释下
下面是网上找来的
Dim baseDateAndTime
Dim newdate
Dim num
Dim y
Dim TempStr
SolarTerm = Array("小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至")
baseDateAndTime = #1/6/1900 2:05:00 AM#
y = mvarsYear
TempStr = ""
Dim i
For i = 1 To 24
num = 525948.76 * (y - 1900) + sTermInfo(i - 1)
newdate = DateAdd("n", num, baseDateAndTime) '按分钟计算,之所以不按秒钟计算,是因为会溢出
If Abs(DateDiff("d", newdate, mvarDate)) = 0 Then
TempStr = SolarTerm(i - 1)
Exit For
End If
Next
Response.Write TempStr