Sams Teach Yourself C in 21 Days

(singke) #1
TABLE19.1 Conversion specifiers that can be used with strftime()
Specifier What It’s Replaced By
%a Abbreviated weekday name.
%A Full weekday name.
%b Abbreviated month name.
%B Full month name.
%c Date and time representation (for example, 10:41:50 30-Jun-91).
%C The year as a decimal number from 00 to 99.
%d Day of month as a decimal number 01 through 31.
%D Is equivalent to “%m/%d/%y”.
%e The day of the month as a decimal number from 1 to 31.
%F Is equivalent to “%Y-%m-%d”.
%h The same as “%b”, the abbreviated month name.
%H The hour (24-hour clock) as a decimal number 00 through 23.
%I The hour (12-hour clock) as a decimal number 00 through 11.
%j The day of the year as a decimal number 001 through 366.
%m The month as a decimal number 01 through 12.
%M The minute as a decimal number 00 through 59.
%p AM or PM.
%r The locale’s 12 hour clock time.
%R Is equivalent to “%H:%M”.
%S The second as a decimal number 00 through 59.
%T Is equivalent to “%H:%M:%S”.
%u The day of week as a decimal number 1 through 7 where 1 is Monday.
%U The week of the year as a decimal number 00 through 53. Sunday is considered
the first day of the week.
%w The weekday as a decimal number 0 through 6 (Sunday = 0).
%W The week of the year as a decimal number 00 through 53. Monday is considered
the first day of the week.
%x The date representation (for example, 30-Jun-91).
%X The time representation (for example, 10:41:50).
%y The year, without century, as a decimal number 00 through 99.
%Y The year, with century, as a decimal number.

540 Day 19

30 448201x-CH19 8/13/02 11:20 AM Page 540

Free download pdf