Token |
Description |
%a |
Abbreviated weekday name (e.g., Mon). |
%A |
Weekday name spelled out (e.g., Monday). |
%b |
Abbreviated month name (e.g., Feb). |
%B |
Month name spelled out (e.g., February). |
%c |
The default date and time representation appropriate for the locale. |
%d |
Day of the month as a decimal number (0131). |
%D |
The date as MM/DD/YY (i.e.: %m/%d/%y ). |
%e |
Day of the month as a decimal, preceded by a blank if zero ( 1-31). |
%h |
Abbreviated month name (an alias for %b , e.g., Feb). |
%H |
Hour in 24-hour format (0023). |
%I |
Hour in 12-hour format (0112). |
%j |
Day of the year as a decimal number, i.e., Julian date (001366). |
%m |
Month as a decimal number (0112). |
%M |
Minute as a decimal number (0059). |
%n |
Insert a newline character. |
%p |
Current locale's A.M./P.M. indicator for 12-hour clock. |
%r |
The time as HH:MM:SS AM/PM (i.e.: %I:%M:%S %p ). |
%R |
The time as HH:MM (i.e.: %H:%M ). |
%S |
Second as a decimal number (0059). |
%t |
Insert a tab character. |
%T |
The time as HH:MM:SS (i.e.: %H:%M:%S ). |
%U |
Week of year as a decimal number, with Sunday as first day of week
(0053). |
%w |
Weekday as a decimal number (06; Sunday is 0). |
%W |
Week of the year as decimal, with Monday as first day of week (0053). |
%x |
The country-specific date representation for the current locale.
|
%X |
The country-specific time representation for the current locale.
|
%y |
Year without the century, as a decimal number (0099). |
%Y |
Year with century, as a decimal number (e.g., 1999 or 2000). |
%z,%Z |
Time-zone name or abbrev; no chars if the time zone is
unknown (e.g., CDT for Central Daylight Time). |
%% |
Percent sign. |