zoukankan      html  css  js  c++  java
  • 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
    %>

  • 相关阅读:
    springboot事务注解@Transactional
    Springboot + mybatis + React+redux+React-router+antd+Typescript(三): 上线
    Springboot + mybatis + React+redux+React-router+antd+Typescript(二): React+Typescrip项目的搭建
    Springboot + mybatis + React+redux+React-router+antd+Typescript(一): 后台Springboot+Mybatis的搭建
    spring(四):spring与mybatis结合
    spring(三):springAOP的各种织入方式一览
    spring(二):简单阐述springAOP的实现原理
    spring(一):spring IoC的注入方式总结
    java web(七): mybatis的动态sql和mybatis generator自动生成pojo类和映射文件
    java web(六):mybatis之一对一、一对多、多对多映射
  • 原文地址:https://www.cnblogs.com/winner/p/400330.html
Copyright © 2011-2022 走看看