Asctime() – C library function Program


Declaration :

Explanation :

Purpose The C library function char *asctime(const struct tm *timeptr) returns a pointer to a string which represents the day and time of the structure struct timeptr.
Parameters
Return Value This function returns a C string containing the date and time information in a human-readable format Www Mmm dd hh:mm:ss yyyy Where Www is the weekday Mmm the month in letters dd the day of the month hh:mm:ss the time and yyyy the year.
Exception

C Program : Example

The following example shows the usage of asctime() function.