百度空间 | 百度首页 
 
查看文章
 
一个根据日期快速查找星座的方法
2008年06月08日 星期日 下午 12:50
编号    起止日期       名称
1     12.22 - 1.19    魔羯
2     1.20 - 2.18     水瓶
3     2.19 - 3.20     双鱼
4     3.21 - 4.20     牡羊
5      4.21 - 5.20     金牛
6     5.21 - 6.21     双子
7      6.22 - 7.22     巨蟹
8      7.23 - 8.22     狮子
9      8.23 - 9.22     处女
10    9.23 - 10.22    天秤
11   10.23 - 11.21   天蝎
12    11.22 - 12.21   射手


'输入日期返回星座编号
Response.write getConstellation(11,23)


Function getConstellation(iMonth, iDay)
     Dim sDay, aDay
     sDay = "20,19,21,21,21,22,23,23,23,23,22,22"
     aDay = Split(sDay,",")
     If iDay < aDay(iMonth - 1) Then
         getConstellation = iMonth
     Else
        getConstellation = iMonth + 1
        If getConstellation = 13 Then getConstellation = 1
     End If
     Erase aDay
     Set aDay = Nothing
End Function


类别:web开发 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu