如何將  Tue Jan 27 16:00:00 CST 2004  轉成 2004/01/28

   Public Function TranCST2Number(ByVal CST As String) As String
        Dim tmpAry As String() = CST.Split(" ")
        Dim thisMonth As Int16
        Select Case tmpAry(1).ToString.ToLower
            Case "jan"
                thisMonth = 1
            Case "feb"
                thisMonth = 2
            Case "mar"
                thisMonth = 3
            Case "apr"
                thisMonth = 4
            Case "may"
                thisMonth = 5
            Case "jun"
                thisMonth = 6
            Case "jul"
                thisMonth = 7
            Case "aug"
                thisMonth = 8
            Case "sep"
                thisMonth = 9
            Case "oct"
                thisMonth = 10
            Case "nov"
                thisMonth = 11
            Case "dec"
                thisMonth = 12
        End Select

        Return tmpAry(5) & "/" & thisMonth.ToString("00") & "/" & tmpAry(2)
   End Function

小雕 發表在 痞客邦 留言(0) 人氣()