欢迎您阅读本文,今天小编为你分享的电脑教程是:【asp的日期转换星座函数】,下面是详细的讲解!
asp的日期转换星座函数
'日期转换星座函数,参数是日期型
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) '重整月日,0903型
rAstro=split("水瓶座*0120*0219#双鱼座*0220*0320#白羊座*0321*0420#金牛座*0421*0521#双子座*0522*0621#巨蟹座*0622*0722#狮子座*0723*0823#处女座*0824*0923#天秤座*0924*1023#天蝎座*1024*1122#射手座*1123*1222#摩蝎座*1222*0119#","#")
astro="摩蝎座" '这个是跨年的,不好对比,先默认
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
关于asp的日期转换星座函数的用户互动如下:
相关问题:ASP中怎么编写一个将当前日期转换成中文日期的自定...
答:中文日期? 只是年月日为中文吧? function getChdate(d) getChdate=year(d)&"年"&month(d)&"月"&day(d)&"日" end function '使用 response.Write getChdate(now()) >>详细
相关问题:ASP中由日期转换为字符串的函数
答:CStr 函数 语言参考 版本 1 请参阅 -------------------------------------------------------------------------------- 描述 返回表达式,该表达式已被转换为 String 子类型的 Variant。 语法 CStr(expression) expression 参数是任意有效的表... >>详细
相关问题:用ASP.NET写通过生日日期自动生成星座的代码
答:/// 返回星座 /// /// /// 日期 /// public static string GetXinZuo(string date) { DateTime d; if (DateTime.TryParse(date, out d)) { d = DateTime.Parse(d.Month + "-" + d.Day); if (d >= DateTime.Parse("03-21") && d = DateTime.Parse... >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
