ASP is a function for converting a date to a constellation

Source: Internet
Author: User

CopyCodeThe Code is as follows: function Astro (birth)
Astro = ""
If birth = "" or not isdate (birth) Then exit function
Birthmonth = month (birth): If birthmonth <10 then birthmonth = "0" & birthmonth
Birthday = Day (birth): If birthday <10 then Birthday = "0" & birthday
Birth = trim (birthmonth & birthday) 'indicates the reorganization of the month and day, type 0903
Rastro = Split ("Aquarius * 0120*0219 # Pisces * 0220*0320 # Aries * 0321*0420 # Taurus * 0421*0521 # Gemini * 0522*0621 # cancer * 0622*0722 # Leo * 0723*0823 # Virgo * 0824*0923 # Libra * 0924*1023 # Scorpio * 1024*1122 # Sagittarius * 1123*1222 # Capricorn * 1222*0119 #", "#")
Astro = "" 'This is a cross-year Plan. It is difficult to compare it. The default value is first.
For I _ls = 0 to ubound (rastro)-2
Rls2 = Split (rastro (I _ls )&"*","*")
If birth> = rls2 (1) and birth <= rls2 (2) then
Astro = rls2 (0)
Exit
End if
Next
End Function
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.