日期:2008-09-30  浏览次数:20997 次

不知道大家去过www.renren.com没有,其中的农历其实就可以这样实现的。。。
如果大家自己有兴趣的话,还可以给农历算法填加好多其他的功能。。。
本程序的限制是只能够转换1950年到2050年之间的农历和公历。。。

cal2.inc文件
<%
    Dim m_minyear
    Dim m_maxyear
    Dim NongLiDayName
    Dim NongLiMonthName
    
    m_minyear        = 1950
    m_maxyear        = 2050
    
    Dim CalendarData(99,2)
    
    NongLiDayName    = Array("初一","初二","初三","初四","初五","初六","初七","初八","初九","初十","十一","十二","十三","十四","十五","十六","十七","十八","十九","廿","廿一","廿二","廿三","廿四","廿五","廿六","廿七","廿八","廿九","三十")
    NongLiMonthName  = Array("正","二","三","四","五","六","七","八","九","十","十一","十二")
    CalendarData(0,0)=&H2f
    CalendarData(0,1)=&H6c
    CalendarData(0,2)=&Ha0
    CalendarData(1,0)=&H24
    CalendarData(1,1)=&Hb5
    CalendarData(1,2)=&H50
    CalendarData(2,0)=&Hda
    CalendarData(2,1)=&H53
    CalendarData(2,2)=&H55
    CalendarData(3,0)=&H2c
    CalendarData(3,1)=&H4d
    CalendarData(3,2)=&Ha0
    CalendarData(4,0)=&H21
    CalendarData(4,1)=&Ha5
    CalendarData(4,2)=&Hb0
    CalendarData(5,0)=&H57
    CalendarData(5,1)=&H45
    CalendarData(5,2)=&H73
    CalendarData(6,0)=&Haa
    CalendarData(6,1)=&H52
    CalendarData(6,2)=&Hb0
    CalendarData(7,0)=&H1e
    CalendarData(7,1)=&Ha9
    CalendarData(7,2)=&Ha8
    CalendarData(8,0)=&H30
    CalendarData(8,1)=&He9
    CalendarData(8,2)=&H50
    CalendarData(9,0)=&H26
    CalendarData(9,1)=&H6a
    CalendarData(9,2)=&Ha0
    CalendarData(10,0)=&H9b
    CalendarData(10,1)=&Hae
    CalendarData(10,2)=&Ha6
    CalendarData(11,0)=&H2d
    CalendarData(11,1)=&Hab
    CalendarData(11,2)=&H50
    CalendarData(12,0)=&H23
    CalendarData(12,1)=&H4b
    CalendarData(12,2)=&H60
    CalendarData(13,0)=&H18
    CalendarData(13,1)=&Haa
    CalendarData(13,2)=&He4
    CalendarData(14,0)=&Hab
    CalendarData(14,1)=&Ha5