aassccttiimmee() -- Time Function (libc)

Convert time structure to ASCII string
#iinncclluuddee <ttiimmee.hh>
#iinncclluuddee <ssyyss/ttyyppeess.hh>
cchhaarr *aassccttiimmee(_t_m_p)
ssttrruucctt ttmm *_t_m_p;

aassccttiimmee() takes the  data found in _t_m_p, and turns  it into an ASCII string.
_t_m_p is  of the  type ttmm, which  is a structure  defined in the  header file
ttiimmee.hh.  This structure  must first  be initialized  by either  ggmmttiimmee() or
llooccaallttiimmee() before it can be used by aassccttiimmee(). For a further discussion of
ttmm, see the entry for ttiimmee.

aassccttiimmee() returns a pointer to where it writes the text string it creates.

_E_x_a_m_p_l_e
The  following  example  demonstrates  the  functions  aassccttiimmee(),  ccttiimmee(),
ggmmttiimmee(),   llooccaallttiimmee(),  and   ttiimmee(),  and  shows   the  effect   of  the
environmental variable  TTIIMMEEZZOONNEE. For a discussion  of the variable ttiimmee_tt,
see the entry for ttiimmee().

#include <time.h>
#include <sys/types.h>
main()
{
    time_t timenumber;
    struct tm *timestruct;

    /* read system time, print using ctime */
    time(&timenumber);
    printf("%s", ctime(&timenumber));

    /* use gmtime to fill tm, print with asctime */
    timestruct = gmtime(&timenumber);
    printf("%s", asctime(timestruct));

    /* use localtime to fill tm, print with asctime */
    timestruct = localtime(&timenumber);
    printf("%s", asctime(timestruct));
}

_S_e_e _A_l_s_o
lliibbcc, ttiimmee(), ttiimmee [oovveerrvviieeww]
ANSI Standard, section 7.12.3.1
POSIX Standard, section 8.1.1

_N_o_t_e_s
aassccttiimmee() returns  a pointer  to a statically  allocated data area  that is
overwritten by successive calls.
