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, expressed as local
time, in the type tm structure pointed to by the timeptr parameter, into
a time since the EPOCH in the same format as that of values returned by
the time function. The original values of parameters timeptr->tm_wday
and timeptr->tm_yday of the structure are ignored, and the original
values of other members of the structure are not restricted to the ranges
defined in the time.h header file. The range [0, 61] for structure member
tm_sec allows for an occasional leap second or double leap second.
A positive or 0 (zero) value for member tm_isdst tells the mktime
function whether daylight saving time is in effect. A negative value for
tm_isdst tells the mktime function to find out whether daylight saving
time is in effect for the specified time. Local time-zone information is
set as though the tzset(3C) function were called.
On successful completion, values for the timeptr->tm_wday and timeptr-
>tm_yday members of the structure are set, and the other members are set
to specified times since the EPOCH, but with their values forced to the
ranges indicated above; the final value of timeptr->tm_mday is not set
until the values of members timeptr->tm_mon and timeptr->tm_year are
determined.
SEE ALSO
time(2), ctime(3C), difftime(3C).
DIAGNOSTICS
Upon successful completion, the mktime function returns the specified
time since the EPOCH written as a value of type time_t . On error, or
whenever the time since the EPOCH cannot be represented, this function
returns the value (time_t)-1.
NOTE
Parts of this discussion are adapted from ANS X3.159-1989.