.TH ctime() "" "" "Time Function (libc)"
.PC "Convert system time to an ASCII string"
.B "#include <time.h>"
.B "#include <sys/types.h>"
\fBchar *ctime(\fItimep\fB)\fR
\fBtime_t *\fItimep\fB;\fR
.PP
.B 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
.BR time_t ,
which is defined in the header file
.BR <sys/types.h> ,
and returns a fixed-length string of the form:
.DM
	Thu Mar  7 11:12:14 1989\en
.DE
.PP
.B ctime()
is implemented as a call to
.B localtime()
followed by a call to
.BR asctime() .
.SH Example
For another example of this function, see the entry for
.BR asctime() .
.DM
#include <time.h>
#include <sys/types.h>
.DE
.DM
main()
{
	time_t t;
.DE
.DM
	time(&t);
	printf("%s\en", ctime(&t));
}
.DE
.SH "See Also"
.Xr "libc," libc
.Xr "time [overview]," time.a
.Xr "time.h" time.h
.br
\*(AS, \(sc7.12.3.2
.br
\*(PX Standard, \(sc8.1
.SH Notes
.B ctime()
returns a pointer to a statically allocated data area that
is overwritten by successive calls.
