

ctime()                   Time Function                   ctime()




Convert system time to an ASCII string

#include <time.h>
#include <sys/types.h>
cchhaarr *ccttiimmee(_t_i_m_e_p) ttiimmee_tt *_t_i_m_e_p;

ctime converts the system's  internal time into a string that can
be read by humans.  It takes  a pointer to the internal time type
time_t, which is defined in the header file time.h, and returns a
fixed-length string of the form:


        Thu Mar  7 11:12:14 1989\n


time_t is defined in the header ttyyppeess.hh.

ctime is implemented as a call to localtime followed by a call to
asctime.

***** Example *****

For another example of this function, see the entry for asctime.


#include <time.h>
#include <sys/types.h>



main()
{
        time_t t;



        time(&t);
        printf(ctime(&t));
}


***** See Also *****

time, time.h

***** Notes *****

ctime returns a pointer  to a statically allocated data area that
is overwritten by successive calls.







COHERENT Lexicon                                           Page 1


