Get_Zodiac(ByVal birthday)
參數:
birthday:傳遞生日時間。
代碼:
Function Get_Zodiac(ByVal birthday)
Dim birthyear,Get_ZodiacList
If IsDate(birthday) Then
birthyear = Year(birthday)
Get_ZodiacList = Array("猴", "雞", "狗", "豬", "鼠", "牛", "虎", "兔", "龍", "蛇", "馬", "羊")
Get_Zodiac = Get_ZodiacList(birthyear Mod 12)
End If
End Function
應用:
Dim input,str
input="1988-05-15"
response.Write(Get_Zodiac(input))
返回:龍