asp怎样根据会员的生日日期计算出星座和属相?日期是2009-02-02

来源:百度知道 编辑:UC知道 时间:2024/05/27 07:35:10
数据库不是SQL的

Public Function Constellation(mDate As Date) As String
'星座
Constellation = Mid("摩羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手摩羯", (Month(mDate) + IIf((Day(mDate) - (19 + Int(Mid("102123444533", Month(mDate), 1)))) >= 0, 0, -1)) * 2 + 1, 2) & "座"
End Function

Public Function Animal(year As Integer) As String
''生肖
Animal = Mid("鼠牛虎兔龙蛇马羊猴鸡狗猪", (((year - 1900) Mod 12) + 12) Mod 12 + 1, 1)
End Function