The FormatDate function can convert any date format to MM/DD/YYYY or DD/MM/YYYY or YYYY/MM/DD formats. Just copy and paste the below function into the asp page and call the function like shown below:
Date Format Function:Function FormatDate(thedate,dformat,dseparator)
Dim myDay
Dim myMonth
Dim myYear
myDay = Day(thedate)
If Len(myDay)=1 Then myDay="0" & myDay
myMonth = Month(thedate)
If Len(myMonth)=1 Then myMonth="0" & myMonth
myYear = Year(thedate)
if dformat="ddmmyyyy" then
FormatDate = myDay & dseparator & myMonth & dseparator & myYear
elseif dformat="yyyymmdd" then
FormatDate = myYear & dseparator & myMonth & dseparator & myDay
else
FormatDate = myMonth & dseparator & myDay & dseparator & myYear
end if
End Function
Usage Examples:response.write FormatDate(date(),"ddmmyyyy","/")
response.write FormatDate(date(),"mmddyyyy","/")
response.write FormatDate(date(),"yyyymmdd","/")