ctime() Time Function ctime() Convert system time to an ASCII string #include <time.h> #include <sys/types.h> char *ctime(timep) time_t *timep; 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 types.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