电脑软硬件应用网
当前位置: 电脑软硬件应用网 > 设计学院 > 网络编程 > ASP教程 > 正文
简单实用ASP实现日期转换星座函数
简单实用ASP实现日期转换星座函数
2010-2-19 9:12:10  文/hiasp   出处:电脑软硬件应用网   

本文介绍一下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生成html或者txt文件实例
    分享常用7款天气预报代码iframe嵌入…
    ASP错误信息解决:IIS启用父路径的设…
    禁止网页缓存的方法及代码
    推荐如何抓取显示防盗链图片的方法
    为什么浏览不了dreamweaver中ASP文件…
    asp入门教程之讲解ASP脚本执行的顺序
    asp将access数据导出为excel电子表的…
    关于45IT | About 45IT | 联系方式 | 版权声明 | 网站导航 |

    Copyright © 2003-2011 45IT. All Rights Reserved 浙ICP备09049068号