Hello
I have the following script on one .asp page:
<HEAD>
<%
Response.Write "<TABLE ALIGN=""TOP""><TR><TD><b><FONT FACE=VERDANA COLOR=#FFFFFF SIZE=1>"
Response.Write WriteDate (Date)
Function Suffix(number)
SELECT CASE Right(Number,1)
CASE 1
temp = "st"
CASE 2
temp = "nd"
case 3
temp = "rd"
CASE ELSE
temp = "th"
END SELECT
Suffix = number & temp
End Function
Function WriteDate(theDate)
WriteDate = Suffix(Day(theDate)) & " " & Monthname(Month(theDate)) & " " & Year(theDate)
End Function
Response.Write "</FONT></b></TD></TR></TABLE>"
%>
</HEAD>
It seems to work when the date is 1st, 2nd, 3rd, 4th, but when it comes to day 12 of the month or day 13, (or day 22 or 23, for that matter), the 1st, 2nd, 3rd does not work (it uses 'th' for all these).
Is there a way around this?
Many thanks.
EvertonFC
I have the following script on one .asp page:
<HEAD>
<%
Response.Write "<TABLE ALIGN=""TOP""><TR><TD><b><FONT FACE=VERDANA COLOR=#FFFFFF SIZE=1>"
Response.Write WriteDate (Date)
Function Suffix(number)
SELECT CASE Right(Number,1)
CASE 1
temp = "st"
CASE 2
temp = "nd"
case 3
temp = "rd"
CASE ELSE
temp = "th"
END SELECT
Suffix = number & temp
End Function
Function WriteDate(theDate)
WriteDate = Suffix(Day(theDate)) & " " & Monthname(Month(theDate)) & " " & Year(theDate)
End Function
Response.Write "</FONT></b></TD></TR></TABLE>"
%>
</HEAD>
It seems to work when the date is 1st, 2nd, 3rd, 4th, but when it comes to day 12 of the month or day 13, (or day 22 or 23, for that matter), the 1st, 2nd, 3rd does not work (it uses 'th' for all these).
Is there a way around this?
Many thanks.
EvertonFC