char * asctime ( const struct tm * tmptr );
Convert tm structure to string.
Converts data pointed by tmptr to a string containing time and date in readable format.
tmptr is a pointer to a tm structure as the ones returned by gmtime and localtime.
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.
Defined in ANSI-C.
/* asctime example */
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
printf ( "Current date and time are: %s", asctime (timeinfo) );
Current date and time are: Sat May 20 15:21:51 2000
ctime, gmtime, localtime, time