Definition | #include <time.h> time_t mktime(struct tm *tm_p);
In the calculation By default, the reference date is always 1/1/1970 00:00:00. If the calendar time cannot be displayed because of missing specifications in the input parameter,
| |
Parameters | struct tm *tm_zg Pointer to a structure of type int tm_sec; seconds (0-59) int tm_min; minutes (0-59) int tm_hour; hours (0-23) int tm_mday; day of the month (1-31) int tm_mon; months since the start of the year (0-11) int tm_year; years since 1900 int tm_wday; weekday (0-6, Sunday=0) int tm_yday; days since January 1 (0-365) int tm_isdst; daylight saving time flag: 0 daylight saving time is not in effect >0 daylight saving time is in effect <0 information is not available
| |
Return val. | Integer>0 | for local times after the reference date (epoch): the number of seconds which have elapsed since then (positive value). |
Integer<0 | for local times prior to the reference date (epoch): the number of seconds which have elapsed up to that point (negative value) | |
(time_t) - 1 | if the time cannot be represented. Furthermore, | |
Note | As -1 is a permissible return value in a successful situation, an application wishing to check for error situations should set errno to 0 before calling the function. | |
See also | asctime, ctime, ctime64, difftime, difftime64, ftime, ftime64, gmtime, gmtime64, localtime, localtime64, time, time64 |