The prototype of the function is written as given below,
time_t mktime (struct tm * Timeptr) ;
The function converts the broken down time representing local time in the structure pointed to by Timeptr into calendar time. In Program the day of the week is determined; it finds the day of the week on 15th August 2010.
Illustrates mktime () function
#include <stdio.h> #include <time.h> int main () { time_t T1; char *const wday[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; struct tm Time ; Time.tm_year = 2010 - 1900; Time.tm_mon = 8 - 1; Time.tm_hour = 21; Time.tm_min = 41; Time.tm_sec = 25; Time.tm_isdst = -1; Time.tm_mday = 15; mktime (&Time); clrscr(); printf("The day is %s.\n", wday [Time.tm_wday]); printf("%u\n", mktime(&Time)); time(&T1); printf("%u\n", T1); return 0; }