
STRFTIME(3)                UNIX Programmer's Manual                STRFTIME(3)

NNAAMMEE
     ssttrrffttiimmee - format date and time

SSYYNNOOPPSSIISS
     ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
     ##iinncclluuddee <<ttiimmee..hh>>
     ##iinncclluuddee <<ssttrriinngg..hh>>

     _s_i_z_e___t
     ssttrrffttiimmee(_c_h_a_r _*_b_u_f, _s_i_z_e___t _m_a_x_s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t,
             _c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_i_m_e_p_t_r)

DDEESSCCRRIIPPTTIIOONN
     The ssttrrffttiimme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 characters 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, including the terminating null
     character, is not more than _m_a_x_s_i_z_e, ssttrrffttiimme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.

     %%AA    is replaced by the full weekday name.

     %%aa    is replaced by the abbreviated weekday name, where the abbreviation
           is the first three characters.

     %%BB    is replaced by the full month name.

     %%bb oorr %%hh
           is replaced by the abbreviated month name, where the abbreviation
           is the first three characters.

     %%CC    is equivalent to ``%a %b %e %H:%M:%S %Y'' (the format produced by
           asctime(3).

     %%cc    is equivalent to ``%m/%d/%y''.

     %%DD    is replaced by the date in the format ```mm/dd/yy'''.

     %%dd    is replaced by the day of the month as a decimal number (01-31).

     %%ee    is replaced by the day of month as a decimal number (1-31); single
           digits are preceded by a blank.

     %%HH    is replaced by the hour (24-hour clock) as a decimal number
           (00-23).

     %%II    is replaced by the hour (12-hour clock) as a decimal number
           (01-12).

     %%jj    is replaced by the day of the year as a decimal number (001-366).

     %%kk    is replaced by the hour (24-hour clock) as a decimal number (0-23);

           single digits are preceded by a blank.

     %%ll    is replaced by the hour (12-hour clock) as a decimal number (1-12);
           single digits are preceded by a blank.

     %%MM    is replaced by the minute as a decimal number (00-59).

     %%mm    is replaced by the month as a decimal number (01-12).

     %%nn    is replaced by a newline.

     %%pp    is replaced by either ``AM'' or ``PM'' as appropriate.

     %%RR    is equivalent to ``%H:%M''

     %%rr    is equivalent to ``%I:%M:%S %p''.

     %%tt    is replaced by a tab.

     %%SS    is replaced by the second as a decimal number (00-60).

     %%ss    is replaced by the number of seconds since the Epoch, UCT (see
           mktime(3)).

     %%TT or %%XX
           is equivalent to ``%H:%M:%S''.

     %%UU    is replaced by the week number of the year (Sunday as the first day
           of the week) as a decimal number (00-53).

     %%WW    is replaced by the week number of the year (Monday as the first day
           of the week) as a decimal number (00-53).

     %%ww    is replaced by the weekday (Sunday as the first day of the week) as
           a decimal number (0-6).

     %%xx    is equivalent to ``%m/%d/%y %H:%M:%S''.

     %%YY    is replaced by the year with century as a decimal number.

     %%yy    is replaced by the year without century as a decimal number
           (00-99).

     %%ZZ    is replaced by the time zone name.

     %%%%    is replaced by `%'.

SSEEEE AALLSSOO
     date(1),  ctime(3),  printf(1),  printf(3)

SSTTAANNDDAARRDDSS
     The ssttrrffttiimmee() function conforms to ANSI C3.159-1989 (``ANSI C''). The
     `%s' conversion specification is an extension.

BBUUGGSS
     There is no conversion specification for the phase of the moon.

BSD Experimental                 June 29, 1991                               2








