ASP的一些自定义函数整理第1/2页(4)


'传人参数: 
'    dateStr:日期字符串 
'    paraType:日期类型-数字型 
'返回值: 
'    格式化后的日期 
'============================================================================================================================ 
Function  DateFormat(dateStr,dateType) 
    Dim dateString 
    if IsDate(dateStr) = False then 
        call ShowErr(language_arr(4)) 
    end if 
    Select Case dateType 
      Case "1" 
          dateString = Year(dateStr)&"-"&Month(dateStr)&"-"&Day(dateStr) 
      Case "2" 
          dateString = Year(dateStr)&"."&Month(dateStr)&"."&Day(dateStr) 
      Case "3" 
          dateString = Year(dateStr)&"/"&Month(dateStr)&"/"&Day(dateStr) 
      Case "4" 
          dateString = Month(dateStr)&"/"&Day(dateStr)&"/"&Year(dateStr) 
      Case "5" 
          dateString = Day(dateStr)&"/"&Month(dateStr)&"/"&Year(dateStr) 
      Case "6" 
          dateString = Month(dateStr)&"-"&Day(dateStr)&"-"&Year(dateStr) 
      Case "7" 
          dateString = Month(dateStr)&"."&Day(dateStr)&"."&Year(dateStr) 
      Case "8" 
          dateString = Month(dateStr)&"-"&Day(dateStr) 
      Case "9" 
          dateString = Month(dateStr)&"/"&Day(dateStr) 
      Case "10" 
          dateString = Month(dateStr)&"."&Day(dateStr) 
      Case "11" 
          dateString = Month(dateStr)&language_arr(6)&Day(dateStr)&language_arr(7) 
      Case "12" 
          dateString = Day(dateStr)&language_arr(7)&Hour(dateStr)&language_arr(8) 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2876.html