char * ctime ( const time_t * timer );
Convert time_t value to string.
Converts timer to a string containing time and date adjusted to local time zone in readable format.
timer is an integer value of type time_t defined as long int by default in most compilers, and usually returned by a call to time function.
The returned string has the following format:
Www Mmm dd hh:mm:ss yyyywhere Www is the weekday, Mmm the month in letters, dd the day of the month, hh:mm:ss the time, and yyyy the year. The string is followed by a new-line character (\n) and a terminating null-character, conforming a total of 26 characters.
A pointer to the string containing the date and time information in readable format.
The string pointed is statically allocated and shared by ctime and asctime functions. Each time one of these functions is called the content of the string is overwritten.
ctime also uses internally the buffer used by gmtime and localtime as return value, so a call to this function will overwrite this.
Defined in ANSI-C.
/* ctime example */
time ( &rawtime );
printf ( "Current date and time are: %s", ctime (&rawtime) );
Current date and time are: Sat May 20 16:05:33 2000
asctime, gmtime, localtime, time