ssttrrffttiimmee() -- Time Function (libc)

Format locale-specific time
#iinncclluuddee <ttiimmee.hh>
ssiizzee_tt ssttrrffttiimmee(_s_t_r_i_n_g, _m_a_x_i_m_u_m, _f_o_r_m_a_t, _b_r_o_k_e_n_t_i_m_e)
cchhaarr *_s_t_r_i_n_g; ssiizzee_tt _m_a_x_i_m_u_m; ccoonnsstt cchhaarr *_f_o_r_m_a_t;
        ccoonnsstt ssttrruucctt ttmm *_b_r_o_k_e_n_t_i_m_e;

The function ssttrrffttiimmee() provides a locale-specific way to print the current
time and  date.  It also gives  you an easy way to  shuffle the elements of
date and time into a string that suits your preferences.

_s_t_r_i_n_g points to the region of memory into which ssttrrffttiimmee() writes the date
and time string it generates.   _m_a_x_i_m_u_m is the maximum number of characters
that  can  be written  into  _s_t_r_i_n_g.  _s_t_r_i_n_g should  point  to  an area  of
allocated memory  at least _m_a_x_i_m_u_m+1  bytes long; if it  does not, reserved
portions of memory may be overwritten.

_b_r_o_k_e_n_t_i_m_e points to a structure of type ttmm, which contains the broken-down
time.  This structure must first  be initialized by either of the functions
llooccaallttiimmee() or ggmmttiimmee().

Finally, _f_o_r_m_a_t  points to  a string that  contains one or  more conversion
specifications, which guide ssttrrffttiimmee() in building its output string.  Each
conversion specification  is introduced by the percent  sign `%'.  When the
output string  is built, each  conversion specification is  replaced by the
appropriate time element.  Characters within  _f_o_r_m_a_t that are not part of a
conversion specification are copied into _s_t_r_i_n_g; to write a literal percent
sign, use ``%%''.

ssttrrffttiimmee() recognizes the following conversion specifiers:

aa  The locale's abbreviated name for the day of the week.

AA  The locale's full name for the day of the week.

bb  The locale's abbreviated name for the month.

BB  The locale's full name for the month.

cc  The locale's default representation for the date and time.

dd  The day of the month as an integer (01 through 31).

HH  The hour as an integer (00 through 23).

II  The hour as an integer (01 through 12).

jj  The day of the year as an integer (001 through 366).

mm  The month as an integer (01 through 12).

MM  The minute as an integer (00 through 59).

pp  The locale's way of indicating  morning or afternoon (e.g, in the United
   States, ``AM'' or ``PM'').

SS  The second as an integer (00 through 59).

UU  The week of the year as an integer (00 through 53); regard Sunday as the
   first day of the week.

ww  The day  of the week as  an integer (0 through 6);  regard Sunday as the
   first day of the week.

WW  The day  of the week as  an integer (0 through 6);  regard Monday as the
   first day of the week.

xx  The locale's default representation of the date.

XX  The locale's default representation of the time.

yy  The year within the century (00 through 99).

YY  The full year, including century.

ZZ  The name of the locale's time  zone.  If no time zone can be determined,
   print a null string.

Use  of any  conversion specifier  other  than the  ones listed  above will
result in undefined behavior.

If the  number of characters written  into _s_t_r_i_n_g is less  than or equal to
_m_a_x_i_m_u_m,  then ssttrrffttiimmee()  returns the number  of characters  written.  If,
however,  the number  of  characters to  be written  exceeds _m_a_x_i_m_u_m,  then
ssttrrffttiimmee() returns zero  and the contents of the area  pointed to by _s_t_r_i_n_g
are indeterminate.

_S_e_e _A_l_s_o
aassccttiimmee(), ccttiimmee(), ggmmttiimmee(), lliibbcc, llooccaallttiimmee(), ttiimmee [oovveerrvviieeww]
ANSI Standard, section 7.12.3.5
POSIX Standard, section 8.1
