programming-examples/asp/Data_Access_DateTime/SwapDate Function.asp

21 lines
774 B
Plaintext
Raw Normal View History

2019-11-18 14:25:58 +01:00
<%
Private Function SwapDate(ByVal dateinput)
Dim strWorkingDate, tmpArray, assemblystring, del, i
strWorkingDate = dateinput
If InStr(strWorkingDate, "/") Then
tmpArray = Split( strWorkingDate, "/" ) : del = "/"
ElseIf InStr(strWorkingDate, "-") Then
tmpArray = Split( strWorkingDate, "-" ) : del = "-"
ElseIf InStr(strWorkingDate, " ") Then
tmpArray = Split( strWorkingDate, " " ) : del = " "
End If
For i = 0 To UBound(tmpArray)
tmpArray( i ) = Replace( tmparray( i ), ",", "" )
Next
assemblystring = tmpArray(1) & del & tmpArray(0)
If del = " " Then assemblystring = assemblystring & ","
assemblystring = assemblystring & del & tmpArray(2)
SwapDate = Trim( assemblystring )
End Function
%>