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

2016-01-29 17:50 15 1 收藏

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

【 tulaoshi.com - ASP 】

 

<%
'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 To:
'   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) = "十一"
  arrDayName(12) = "十二"
  arrDayName(13) = "十三"
  arrDayName(14) = "十四"
  arrDayName(15) = "十五"
  arrDayName(16) = "十六"
  arrDayName(17) = "十七"
  arrDayName(18) = "十八"
  arrDayName(19) = "十九"
  arrDayName(20) = "二十"
  arrDayName(21) = "廿一"
  arrDayName(22) = "廿二"
  arrDayName(23) = "廿三"
  arrDayName(24) = "廿四"
  arrDayName(25) = "廿五"
  arrDayName(26) = "廿六"
  arrDayName(27) = "廿七"
  arrDayName(28) = "廿八"
  arrDayName(29) = "廿九"
  arrDayName(30) = "三十

来源:http://www.tulaoshi.com/n/20160129/1503179.html

延伸阅读
标签: Web开发
最近因工作需要,要在静态页面上实现分页,想了下,决定用AJAX来实现,所以就捣鼓了下面这么个东西,截图如下: 代码如下: html head titleAJAX静态分页/title meta http-equiv="content-type" content="text/html;charset=gb2312" style type="text/css" !-- body        &...
标签: ASP
  是因工作需要做的一个批量修改代码的小东西,拿出来与大家分享 目前可以处理的文件类型:.asp .inc .htm .html 具体类型可自行修改添加 程序实现的功能:将源目录下的文件批量修改后存到目的目录下 用它稍做修改可以实现很多东西噢! 别的不说了,代码里面都写的很清楚了 <% '// +----------------------------------------------...
标签: Web开发
后台数据库: [Microsoft Access] 与 [Microsoft Sql Server] 更换之后,ASP代码应注意要修改的一些地方: [一]连接问题(举例) [Microsoft Access] constr = "DBQ=c:dataclwz.mdb; DRIVER={Microsoft Access Driver (*.mdb)}" [Microsoft Sql Server] constr = "DRIVER={SQL Server};SERVE...
标签: Web开发
代码如下: style td { font-family: "宋体"; font-size:9pt} /style body bgcolor="eeeeee" table width="180" cellpadding="0" cellspacing="1" bgcolor="dddddd" style="text-align:center" % '以下为ASP中通过该日历算法实现的具体代码     '先判断是否指...
标签: Web开发
以下为引用的内容: html head title不刷新页面查询的方法/title meta http-equiv="Content-Type" content="text/html; charset=gb2312" /head script language="javascript" !--初始化,将数据岛中数据装入列表框中-- function loadinsel() { var employeeid,employeelastname; //分别存放雇员ID和雇员名字 root=document....

经验教程

472

收藏

13
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部