推荐下天枫常用ASP函数封装,推荐大家使用

2019-04-02 04:46:55于丽

        elseif dsize>=1024 then
            FormatSize=Formatnumber(dsize/1024,2) & " KB"
        else
            FormatSize=dsize & " Byte"
        end if
    End Function

    '****************************************************
    '函数名:FormatTime
    '作  用:时间格式化
    '参  数:DateTime ----要格式化的时间
    '       Format   ----格式的形式
    '****************************************************
    Public Function FormatTime(DateTime,Format) 
        select case Format
        case "1"
             FormatTime=""&year(DateTime)&"年"&month(DateTime)&"月"&day(DateTime)&"日"
        case "2"
             FormatTime=""&month(DateTime)&"月"&day(DateTime)&"日"
        case "3" 
             FormatTime=""&year(DateTime)&"/"&month(DateTime)&"/"&day(DateTime)&""
        case "4"
             FormatTime=""&month(DateTime)&"/"&day(DateTime)&""
        case "5"
             FormatTime=""&month(DateTime)&"月"&day(DateTime)&"日"&FormatDateTime(DateTime,4)&""
        case "6"
           temp="周日,周一,周二,周三,周四,周五,周六"
           temp=split(temp,",") 
           FormatTime=temp(Weekday(DateTime)-1)
        case Else
        FormatTime=DateTime
        end select
    End Function

'----------------------杂项---------------------
    '****************************************************