STRFTIME(3) UNIX Programmer's Manual STRFTIME(3) NNAAMMEE strftime - format date and time SSYYNNOOPPSSIISS ##iinncclluuddee <<ssyyss//ttyyppeess..hh>> ##iinncclluuddee <<ttiimmee..hh>> ##iinncclluuddee <<ssttrriinngg..hh>> ssiizzee__tt ssttrrffttiimmee((cchhaarr **ss,, ssiizzee__tt mmaaxxssiizzee,, ccoonnsstt cchhaarr **ffoorrmmaatt,, ccoonnsstt ssttrruucctt ttmm **ttiimmeeppttrr));; DDEESSCCRRIIPPTTIIOONN The _s_t_r_f_t_i_m_e function formats the information from _t_i_m_e_p_t_r into the buffer _b_u_f according to the string pointed to by _f_o_r_m_a_t. The _f_o_r_m_a_t string consists of zero or more conversion specifications and ordinary characters. All ordinary char- acters are copied directly into the buffer. A conversion specification consists of a percent sign (``%'') and one other character. No more than _m_a_x_s_i_z_e characters will be placed into the array. If the total number of resulting characters, includ- ing the terminating null character, is not more than _m_a_x_- _s_i_z_e, _s_t_r_f_t_i_m_e returns the number of characters in the array, not counting the terminating null. Otherwise, zero is returned. Each conversion specification is replaced by the characters as follows which are then copied into the buffer. %%AA is replaced by the full weekday name. %%aa is replaced by the abbreviated weekday name, where the abbreviation is the first three characters. %%BB is replaced by the full month name. %%bb oorr %%hh is replaced by the abbreviated month name, where the abbreviation is the first three characters. %%CC is equivalent to ``%a %b %e %H:%M:%S %Y'' (the format produced by _a_s_c_t_i_m_e(3). %%cc is equivalent to ``%m/%d/%y''. %%DD is replaced by the date in the format ``mm/dd/yy''. %%dd is replaced by the day of the month as a decimal number Printed 7/27/90 1Q 1 STRFTIME(3) UNIX Programmer's Manual STRFTIME(3) (01-31). %%ee is replaced by the day of month as a decimal number (1-31); single digits are preceded by a blank. %%HH is replaced by the hour (24-hour clock) as a decimal number (00-23). %%II is replaced by the hour (12-hour clock) as a decimal number (01-12). %%jj is replaced by the day of the year as a decimal number (001-366). %%kk is replaced by the hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank. %%ll is replaced by the hour (12-hour clock) as a decimal number (01-12); single digits are preceded by a blank. %%MM is replaced by the minute as a decimal number (00-59). %%mm is replaced by the month as a decimal number (01-12). %%nn is replaced by a newline. %%pp is replaced by either ``AM'' or ``PM'' as appropriate. %%RR is equivalent to ``%H:%M''. %%rr is equivalent to ``%I:%M:%S %p''. %%tt is replaced by a tab. %%SS is replaced by the second as a decimal number (00-60). %%TT oorr %%XX is equivalent to ``%H:%M:%S''. %%UU is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number (00-53). %%WW is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (00-53). %%ww is replaced by the weekday (Sunday as the first day of the week) as a decimal number (0-6). %%xx is equivalent to ``%m/%d/%y %H:%M:%S''. %%YY is replaced by the year with century as a decimal number. Printed 7/27/90 2Q 2 STRFTIME(3) UNIX Programmer's Manual STRFTIME(3) %%yy is replaced by the year without century as a decimal number (00-99). %%ZZ is replaced by the time zone name. %%%% is replaced by ``%''. SSEEEE AALLSSOO date(1), ctime(3), printf(1), printf(3) SSTTAANNDDAARRDDSS SSttrrffttiimmee conforms to ANSI X3.159-1989 (``ANSI C''). Printed 7/27/90 3Q 3