标题:纯asp版带农历日历。谁有好的农历节气算法?
只看楼主
dl63502925
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-10-28
 问题点数:0 回复次数:0 
纯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

搜索更多相关主题的帖子: 节气 农历 算法 web 
2007-10-28 15:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-181425-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.256631 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved