<%
' change US date (March 1st, 2000) to Int'l (1st March, 2000)
' 2 digit year
response.write SwapDate("3/1/00") & "<BR>"
' 4 digit year
response.write SwapDate("3/1/2000") & "<BR>"
' worded month, 4 digit year
response.write SwapDate("March 1, 2000") & "<BR>"
' change Int'l date (31 Sept, 2000) into a US date (Sept 31, 2000)
' worded month, 4 digit year
response.write SwapDate("31 September, 2001") & "<BR>"
' 4 digit year
response.write SwapDate("30-9-2001") & "<BR>"
' 2 digit year
response.write SwapDate("31/9/01") & "<BR>"
%>
<%
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
%>