mktime

Converts the local time information into seconds since the epoch.

Library:LibC
Classification:ANSI
Service:Time

Syntax

  #include <time.h> 
   
  time_t mktime (
     struct tm   *localtime);
  

Parameters

localtime

(IN) Points to the tm structure containing the local time information to convert.

Return Values

If successful, returns the converted time. Otherwise, returns -1.

Remarks

The mktime function converts the local time information in the structure pointed to by the localtime parameter into a calendar time with the same encoding used by the time function. Calendar time is expressed in seconds since the epoch began (January 1, 1970, 00:00:00).

The mktime function sets the local timezone information.

See Also