当前位置: 首页 > 图文教程 > 网络编程 > ASP > 功能非常全面的日期处理函数

ASP
基于ASP的收发文管理系统的设计与实现
用ASP制作张扬个性的调查系统
使用XMLHTTP制作域名查询系统
Delphi编写组件封装asp代码的基本步骤
采用XMLHTTP编写一个天气预报的程序
菜鸟详听ASP中也能解压缩rar文件
用Asp+XmlHttp实现RssReader功能
纯ASP代码之公历转农历实现(含属相)
纯ASP代码之公历转农历实现(含属相)--例子代码
多个域名后缀同时查询的域名查询系统
实现有管理功能的ASP留言板
Jmail发信的实例,模块化随时调用
纯ASP(VBscript)写的全球IP地址搜索程序
数字和字母组合并生成图片的验证码祥解
金额大小写转换的asp完全无错版本
用ASP学做一个在线调查
利用客户端js实现汉字简体繁体转换
ASP操作XML文件的完整实例
浅谈TeeChart组件在ASP中的应用
在VB中利用Word宏命令开发ASP组件

ASP 中的 功能非常全面的日期处理函数


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

  <script language=javascript>
function fnSubmit(strPage)
{
  document.forms[0].action= strPage
  document.forms[0].submit()    
}

</script>
<%

call writedropdowns

Sub writeDropDowns()
  Dim strSelfLink
  strSelfLink = request.servervariables("SCRIPT_NAME")
  response.Write "<form name=dates method=post>" & vbcrlf
  response.Write MonthDropDown("month1",False,request("month1"),strSelfLink) & " " & DayDropDown("day1", "",getDaysInMonth(request("month1"),request("year1")),request("day1")) & " " & YearDropDown("year1","","", request("year1"),strSelfLink) & vbcrlf
  response.Write "</form>"    & vbcrlf
End Sub
        

Function MonthDropDown(strName, blnNum, strSelected, strSelfLink)
  Dim strTemp, i, strSelectedString            
  strTemp = "<select name='" & strName& "' onchange='javascript: fnSubmit(" & chr(34) & strSelfLink & chr(34) & ")'>" & vbcrlf
  strTemp = strTemp & "<option value='" & 0 & "'>" & "Month" & "</option>" & vbcrlf            
  For i = 1 To 12
    If strSelected = CStr(i) Then
    strSelectedString = "Selected"
    Else
    strSelectedString = ""
    End If
            
    If blnNum Then
      strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & i & "</option>" & vbcrlf            
    Else
    strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & MonthName(i) & "</option>" & vbcrlf            
    End If
  Next                    
  strTemp = strTemp & "</select>" & vbcrlf    
  MonthDropDown = strTemp
End Function


Function YearDropDown(strName, intStartYear, intEndYear, strSelected, strSelfLink)
  
  Dim strTemp, i, strSelectedString    
  
  If intStartYear = "" Then
    intStartYear = Year(now())
  End If    
    
  If intEndYear = "" Then
    intEndYear = Year(now()) + 9
  End If
    
  strTemp = "<select name='" & strName& "' onchange='javascript: fnSubmit(" & chr(34) & strSelfLink & chr(34) & ")'>" & vbcrlf            
  strTemp = strTemp & "<option value='" & 0 & "'>" & "Year" & "</option>" & vbcrlf