Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- ''
- ' A basic copy of PHP's version of date('S')
- ' "English ordinal suffix for the day of the month, 2 characters"
- ' @param int day The day suffix you are looking for.
- ' @return st ring This is the suffix you were looking for.
- ''
- Function getS(fn_day)
- If fn_day = "" Then
- fn_day = CStr(DAY(NOW()))
- Else
- fn_day = CStr(CInt(fn_day))
- End If
- fnll = Mid(fn_day, len(fn_day), 1)
- If len(fn_day) = 1 Then
- fndl = -1
- Else
- fndl = Mid(fn_day, len(fn_day)-1, 2)
- End If
- If fndl >= 11 AND fndl <= 13 Then
- getS = "th"
- Exit Function
- ElseIf fnll = 1 Then
- getS = "st"
- Exit Function
- ElseIf fnll = 2 Then
- getS = "nd"
- Exit Function
- ElseIf fnll = 3 Then
- getS = "rd"
- Exit Function
- Else
- getS = "th"
- Exit Function
- End If
- End Function
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement