I believe formatdatatime requires a named format. In order to do 'dd/mm/yyyy' you have to change your shortdate format in the region settings of the server to match that, then use formatdatetime(date, vbShortDate)
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
1. Write a Dll in VB that wraps the Format() function and create an object from this Dll in your ASP code.
2. Write your own custom date function in your ASP that uses the Day(), Month(), and Year() functions to put your date into the format you desire. For example:
Code:
<%
Function FormatDateCustom(DateToFormat)
Dim strReturn
Dim strTemp
' Day.
strTemp = Day(DateToFormat)
If Len(strTemp) = 1 Then
strTemp = "0" & strTemp
End If
strReturn = strTemp
' Month.
strTemp = Month(DateToFormat)
If Len(strTemp) = 1 Then
strTemp = "0" & strTemp
End If
strReturn = strReturn & "/" & strTemp
' Year.
strTemp = Mid(Year(DateToFormat), 3, 2)
strReturn = strReturn & "/" & strTemp
FormatDateCustom = strReturn
End Function
' Which could be called like:
Response.Write "<P>" & FormatDateCustom(Now) & "</P>" & vbcrlf
%>
Ahem: I wrote that code today. Who do you think you are?
I am a bit lost here, am i the only one .
I havent had a look at any one of your code, but looking at what you have posted, i have to say its a very common method. i myself has written very similar functions to format date and time which i reuse in my applications.