| Formatting Identifiers | |
|---|---|
%m | Month as a decimal (02) |
%B | Full month name (February) |
%b | Abbreviated month name (Feb ) |
%d | Day of the month (23) |
%O | Ordinal of day of month (eg st or rd or nd) |
%j | Day of the year (54) |
%Y | Year with century (1998) |
%y | Year without century (98) |
%W | Weekday as integer (0 is Sunday) |
%a | Abbreviated day name (Fri) |
%A | Weekday Name (Friday) |
%H | Hour in 24 hour format (24) |
%h | Hour in 12 hour format (12) |
%N | Minute as an integer (01) |
%n | Minute as optional if minute <> 0 |
%S | Second as an integer (55) |
%P | AM/PM Indicator (PM) |
For example, if we call this function with the code:
Response.Write "Today is " & fncFmtDate(Now(), "%A the %d%O of %B, %Y")
|
We'll get the following output:
Today is Saturday the 4th of July, 2009
Give it a try yourself! Into the two text boxes below enter the date and the customizable date formatting string.
The output of: fncFmtDate("7/4/2009 11:42:49 AM", %m-%d-%y) is:
7-4-09