View Single Post
Old 08-19-2003, 05:44 PM   PM User | #8
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
Hmm, I don't think there's a non-clunky way of doing this. Here's a VBScript version that I use:
Code:
Function DateExt(ByVal intDay)
	If IsNumeric(intDay) Then
		If CInt(intDay) <> intDay Then Exit Function
		If (intDay < 11) OR (intDay > 13) Then
			Select Case Right(intDay,1)
				Case 1
					DateExt = intDay & "st"
				Case 2
					DateExt = intDay & "nd"
				Case 3
					DateExt = intDay & "rd"
				Case Else
					DateExt = intDay & "th"
			End Select
		Else
			DateExt = intDay & "th"
		End If
	End If
End Function
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote