ASP's Date conversion constellation function

Source: Internet
Author: User
Tags exit split

' Date conversion constellation function, parameter is date type
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) ' Reforming month, 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= "Capricorn" ' This is a cross year, bad contrast, the first default
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 For
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.