Convert Arabic numeral date to Chinese numeric date format (ASP)

Source: Internet
Author: User
Tags numeric split
Transformation just saw a brother to ask the question, finished just found already knot paste, depressed ah ~ ~
Just see this thing is useful, so posted out from the reward hehe
Ideas:
At first the thought of using Select, for the loop to convert each Arabic numeral to the corresponding Chinese, and then think of actually can use an array, this looks less code, after all, 0~9, can correspond, but ~ problem appeared, for 10~31, to become "two pick one" such format, hehe ~ Add a judgment, Well, ~11 can not be converted into "one pick one", in addition to judge
Oh ~ basically good, still need to judge is not the number, ok! This should be can be over!
<%
T=now ()
Function Datetostr (t)
Dim Stryear,strmonth,strday,strresult
Stryear = year (t)
Strmonth = Month (t)
Strday = Day (t)
Datetostr = Casei (stryear) & "Year" & Casei (Strmonth) & "Month" & Casei (strday) & "Day"
End Function
Function Casei (i)
Dim Arrnum,arrcnnum
If (IsNumeric (i)) Then
Arrnum = Split (i)
Arrcnnum=split ("Zero, one, II, three, establishments, Wu, Lu, Qi, BA, JIU", ",")
If (i<10 OR i>31) Then
For It=1 to Len (i)
strresult = strresult & Arrcnnum (CInt (Mid (i,it,1))
Next
ElseIf (i > 9 and I <) Then
strresult = "Pick Up" & Arrcnnum (CInt (Mid (i,2,1))
Else
strresult = Arrcnnum (CInt (Mid (i,1,1)) & "Pick" & Arrcnnum (CInt (Mid (i,2,1))
End If
End If
Casei = Strresult
End Function
Response.Write (Datetostr (t))
%>



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.