当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp实现计算两个时间内的工作日的函数

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP 中的 asp实现计算两个时间内的工作日的函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 223 ::
收藏到网摘: n/a

<%
'******************************
'函数:workdays(date_begin , date_end)
'参数:date_begin,开始日期;date_end,结束日期
'作者:阿里西西
'日期:2007/7/15
'描述:计算两个时间内的工作日
'示例:workdays("2007-05-18" , "2007-05-21")
'******************************
function workdays(date_begin , date_end)
date_begin = CDate(date_begin)
date_end = CDate(date_end)
if IsDate(date_begin) and IsDate(date_end) then
workdays = 0
for d=0 to datediff("d" , date_begin , date_end)
if weekday(date_begin + d) <> 1 and weekday(date_begin + d) <> 7 then
workdays = workdays + 1
end if
next
else
workdays = "未知"
end if
end function
%>