MKTIME(3C) SysV MKTIME(3C)
NAME
mktime - convert broken-down time to calendar time
SYNOPSIS
#include <time.h>
time_t mktime(timeptr)
struct tm *timeptr;
DESCRIPTION
The mktime function converts the broken-down time contained in the
structure pointed to by timeptr and converts it to calendar time (the
format returned by time(2)). The original values of timeptr->tm_wday and
timeptr->tm_yday are ignored, and the original values of the other time
components are not restricted to the values documented in time(4).
The contents of the tm structure pointed to by timeptr may be modified.
On successful completion, the values of timeptr->tm_wday and
timeptr->tm_yday are set appropriately, and the other components are set
to represent the specified calendar time, but with their values coerced
to the ranges specified in time(4). The final value of timeptr->tm_mday
is not set until timeptr->tm_mon and timeptr->tm_year are determined.
SEE ALSO
time(2), ctime(3C), difftime(3C).
DIAGNOSTICS
mktime returns the specified calendar time, or (time_t)-1 if
unsuccessful.
NOTE
Parts of this discussion are adapted from ANS X3.159-1989.