Command | Replaced By |
%a | Abbreviated weekday name |
%A | Full weekday name |
%b | Abbreviated month name |
%B | Full month name |
%c | Standard date and time string |
%C | Last two digits of year |
%d | Day of month as a decimal (1-31) |
%D | month/day/year (added by C99) |
%e | Day of month as a decimal (1-31) in a two-character field (added by C99) |
%F | year-month-day (added by C99) |
%g | Last two digits of year using a week-based year (added by C99) |
%G | The year using a week-based year (added by C99) |
%h | Abbreviated month name (added by C99) |
%H | Hour (0-23) |
%I | Hour (1-12) |
%j | Day of year as a decimal (1-366) |
%m | Month as decimal (1-12) |
%M | Minute as decimal (0-59) |
%n | A newline (added by C99) |
%p | Locale's equivalent of AM or PM |
%r | 12-hour time (added by C99) |
%R | hh:mm (added by C99) |
%S | Second as decimal (0-60) |
%t | Horizontal tab (added by C99) |
%T | hh:mm:ss (added by C99) |
%u | Day of week; Monday is first day of week (0-53) (added by C99) |
%U | Week of year, Sunday being first day (0-53) |
%V | Week of year using a week-based year (added by C99) |
%w | Weekday as a decimal (0-6, Sunday being 0) |
%W | Week of year, Monday being first day (0-53) |
%x | Standard date string |
%X | Standard time string |
%y | Year in decimal without century (0-99) |
%Y | Year including century as decimal |
%z | Offset from UTC (added by C99) |
%Z | Time zone name |
%% | The percent sign |
A week-based year is used by the %g, %G, and %V format commands.
With this representation, Monday is the first day of the week, and the first week of a year must include January 4.