|
|
1.1 ! root 1: ! 2: ! 3: ctime() Time Function ctime() ! 4: ! 5: ! 6: ! 7: ! 8: Convert system time to an ASCII string ! 9: ! 10: #include <time.h> ! 11: #include <sys/types.h> ! 12: cchhaarr *ccttiimmee(_t_i_m_e_p) ttiimmee_tt *_t_i_m_e_p; ! 13: ! 14: ctime converts the system's internal time into a string that can ! 15: be read by humans. It takes a pointer to the internal time type ! 16: time_t, which is defined in the header file time.h, and returns a ! 17: fixed-length string of the form: ! 18: ! 19: ! 20: Thu Mar 7 11:12:14 1989\n ! 21: ! 22: ! 23: time_t is defined in the header ttyyppeess.hh. ! 24: ! 25: ctime is implemented as a call to localtime followed by a call to ! 26: asctime. ! 27: ! 28: ***** Example ***** ! 29: ! 30: For another example of this function, see the entry for asctime. ! 31: ! 32: ! 33: #include <time.h> ! 34: #include <sys/types.h> ! 35: ! 36: ! 37: ! 38: main() ! 39: { ! 40: time_t t; ! 41: ! 42: ! 43: ! 44: time(&t); ! 45: printf(ctime(&t)); ! 46: } ! 47: ! 48: ! 49: ***** See Also ***** ! 50: ! 51: time, time.h ! 52: ! 53: ***** Notes ***** ! 54: ! 55: ctime returns a pointer to a statically allocated data area that ! 56: is overwritten by successive calls. ! 57: ! 58: ! 59: ! 60: ! 61: ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.