• asp格式时间的函数


    <%Response.Expires = 0%>
    <%
     function FormatDate(sStr,sFormat,sChar)
     if sStr = "" or not isdate(sStr) or sChar="" then
      'Response.Write "NULL"
      FormatDate = ""
      exit function
     end if
     
     dim sYear,sMonth,sDay,sHour,sMinute,sSecond
     sYear = year(sStr)
     if len(sYear)< 4 then sYear ="20" & sYear
     sMonth = month(sStr)
     if clng(sMonth)<10 and len(sMonth)<2 then sMonth = "0" & sMonth
     sDay = day(sStr)
     if clng(sDay)<10 and len(sDay)<2 then sDay = "0" & sDay
     sHour = hour(sStr)
     if clng(sHour)<10 and len(sHour)<2 then sHour = "0" & sHour
     sMinute = Minute(sStr)
     if clng(sMinute)<10 and len(sMinute)<2 then sMinute = "0" & sMinute
     sSecond = Second(sStr)
     if clng(sSecond)<10 and len(sSecond)<2 then sSecond = "0" & sSecond
     
     select case ucase(sFormat)
     case "YYYYMM"
      FormatDate = sYear & sChar & sMonth
     case "YYYYMMDD"
      FormatDate = sYear & sChar & sMonth & sChar & sDay
     case "YYYYMM@"
      FormatDate = sYear & "Äê" & sMonth  & "ÔÂ"
     case "YYYYMMDD@"
      FormatDate = sYear & "Äê" & sMonth & "ÔÂ" & sDay & "ÈÕ"
     case "YYYYMMDDHHMMSS_NULL"
      
      FormatDate = sYear & sMonth & sDay & sHour & sMinute & sSecond
     case "YYYYMMDDHHMMSS"
      FormatDate = sYear & sChar & sMonth & sChar & sDay & " " & sHour & ":"  & sMinute
     case "YYYYMMDDHHMM"
      FormatDate = sYear & sChar & sMonth & sChar & sDay & " " & sHour & ":"  & sMinute 
     case "YYYYMMDDHHMMSS@"
      FormatDate = sYear & "Äê" & sMonth & "ÔÂ" & sDay & "ÈÕ" & sHour & "ʱ"  & sMinute & "·Ö" & sSecond & "Ãë"
       
     case else
      formatDate = sStr   
     end select
    end function

    function getTextarea(sStr)
     if sStr = "" then
      sStr = ""
     else   
      sStr = Replace(Replace(sStr,chr(10),"<br>"),chr(32),"&nbsp;")  
     end if
     getTextarea = sStr
    end function

    function getTextareatodb(sStr)
     if sStr = "" then
      sStr = ""
     else   
      sStr = Replace(Replace(sStr,chr(10),"<br>"),chr(32),"&nbsp;")
      
     end if
     getTextareatodb = sStr
    end function

    function DeTextarea(sStr)
     if sStr = "" then
      sStr = ""
     else
      sStr = Replace(Replace(sStr,"<br>",chr(10)),"&nbsp;",chr(32))
     end if
     DeTextarea = sStr
    end function

    function pub_getMemoValue(sStr)
     dim s_str
      s_str = sStr
     if s_str = "" or isnull(s_str) then
      pub_getMemoValue = "&nbsp;"
     else
      pub_getMemoValue = rtrim(s_str)
     end if
    end function

    function pub_getMemoValue_sub(sStr,sLen)
     dim s_str
      s_str = sStr
     if s_str = "" or isnull(s_str) then
      pub_getMemoValue_sub = "&nbsp;"
     else
      if len(s_str)>sLen then
       pub_getMemoValue_sub = rtrim(mid(s_str,1,sLen)) & "..."
      else
       pub_getMemoValue_sub = rtrim(s_str)
      end if
     end if
    end function
    %>

  • 相关阅读:
    Download: Microsoft Access Database Engine 2010 Redistributable
    18大顺丰不发航空件
    北京南站不是24*7的
    360压缩虽然有占霸道,但是for free,我已经不想去找破解软件了
    VS2010、SQL Server 2008和SQL Server 2012安装详解
    【新提醒】LENOVO_WIN7_SP1_UM_64_CN_RDVD远景Windows7,Windows8,旗舰版,系统下载,主题
    原来qq下载也有类似迅雷的功能了
    如意通5元卡办理了,可以用wifi热点了
    SQLEXPR.EXE 和 SQLEXPR32.EXE的区别 挨踢人 博客园
    HTTP Proxy Support
  • 原文地址:https://www.cnblogs.com/winner/p/400330.html
Copyright © 2020-2023  润新知