您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > ASP >

纯ASP代码实现公历转农历(含属相)

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 18:49 点击:

有没有试过弄一个公历转农历的程序?今天让我们一起来尝试一下吧:

<%
Option Explicit
***********************************************
类名称:ChinaDay
用途:
  根据输入的日期计算该日期的农历天干地支及当年属相
使用方法:
第一个参数为输入参数,不填写默认为当日,
只计算1921-2-8之后的日期
##-------------------------------------------##
Dim objChinaDay
Dim sDay, sWeekDay, sChinaDay, sChinaYear,sChinaAni
Set objChinaDay = New  ChinaDay
Call objChinaDay.Action("",sDay,sWeekDay,sChinaYear,sChinaDay,sChinaAni)
Response.Write sDay&"<BR>"
Response.Write sWeekDay&"<BR>"
Response.Write sChinaYear&"<BR>"
Response.Write sChinaDay&"<BR>"
Response.Write sChinaAni&"<BR>"
##-------------------------------------------##
Modify By:Babyt(阿泰)
Mail:  Babyt@mail.csdn.net
Welcome T
   http://blog.csdn.net/babyt/
   http://www.facesun.cn
Created At: 2005-2-20
Copyright: 本代码非原创,是2001年收集的,原作者未知。
License:Free
*******************************************************
Class ChinaDay
 
 Dim arrWeekName(7), MonthAdd(11), NongliData(99)
 Dim arrTianGan(9), arrDiZhi(11), arrShuXiang(11), arrDayName(30), arrMonName(12)
 Dim curTime, curYear, curMonth, curDay, curWeekday
 Dim i, m, n, k, isEnd, bit, TheDate
 
 初始化数据
 Sub Class_Initialize()
  ---------------------------------------------------
  定义显示字串
 
  星期名
  arrWeekName(0) = "*"
  arrWeekName(1) = "星期日"
  arrWeekName(2) = "星期一"
  arrWeekName(3) = "星期二"
  arrWeekName(4) = "星期三"
  arrWeekName(5) = "星期四"
  arrWeekName(6) = "星期五"
  arrWeekName(7) = "星期六"
 
  天干名称
  arrTianGan(0) = "甲"
  arrTianGan(1) = "乙"
  arrTianGan(2) = "丙"
  arrTianGan(3) = "丁"
  arrTianGan(4) = "戊"
  arrTianGan(5) = "己"
  arrTianGan(6) = "庚"
  arrTianGan(7) = "辛"
  arrTianGan(8) = "壬"
  arrTianGan(9) = "癸"
 
  地支名称
  arrDiZhi(0) = "子"
  arrDiZhi(1) = "丑"
  arrDiZhi(2) = "寅"
  arrDiZhi(3) = "卯"
  arrDiZhi(4) = "辰"
  arrDiZhi(5) = "巳"
  arrDiZhi(6) = "午"
  arrDiZhi(7) = "未"
  arrDiZhi(8) = "申"
  arrDiZhi(9) = "酉"
  arrDiZhi(10) = "戌"
  arrDiZhi(11) = "亥"
 
  属相名称
  arrShuXiang(0) = "鼠"
  arrShuXiang(1) = "牛"
  arrShuXiang(2) = "虎"
  arrShuXiang(3) = "兔"
  arrShuXiang(4) = "龙"
  arrShuXiang(5) = "蛇"
  arrShuXiang(6) = "马"
  arrShuXiang(7) = "羊"
  arrShuXiang(8) = "猴"
  arrShuXiang(9) = "鸡"
  arrShuXiang(10) = "狗"
  arrShuXiang(11) = "猪"
 
  农历日期名
  arrDayName(0) = "*"
  arrDayName(1) = "初一"
  arrDayName(2) = "初二"
  arrDayName(3) = "初三"
  arrDayName(4) = "初四"
  arrDayName(5) = "初五"
  arrDayName(6) = "初六"
  arrDayName(7) = "初七"
  arrDayName(8) = "初八"
  arrDayName(9) = "初九"
  arrDayName(10) = "初十"
  arrDayName(11) = "十一"

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • WAP常见问题问答大全(四)
      • ASP开发必备:WEB打印代码大全
      • ASP调用系统ping命令
      • asp缓存技术
      • ASP教程:第三篇 ASP基础
      • 用ASP+XML打造留言本(4)
      • 关于ASP Recordset 分页出现负数解决方法及建议
      • 用asp怎样编写文档搜索页面(5)
      • ASP处理多关键词查询实例代码
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1