mktime()

convert local time to seconds since the Epoch 

Function


SYNOPSIS

#include <time.h>

time_t mktime(struct tm *timeptr);


DESCRIPTION

The mktime() function converts the broken-down time, expressed as local time, in the structure pointed to by timeptr into a calendar time value with the same encoding as that of the values returned by the time() function. The original values of the tm_wday and tm_yday components of the structure are ignored, and the original values of the other components are not restricted to their normal values.

A positive or 0 value for tm_isdst causes mktime() to presume initially that Daylight Savings Time either is or is not in effect, respectively, for the specified time. A negative value for tm_isdst causes mktime() to attempt to determine whether Daylight Savings Time is in effect for the specified time. Local time zone information is set as though mktime() called tzset().


PARAMETERS

timeptr 

Points to the time structure to be converted to time_t.


RETURN VALUES

On success, mktime() returns the time_t equivalent of timeptr. In addition, the tm_wday and tm_yday components of the structure are set appropriately, and the other components are set to represent the specified time, with their values forced to the normal ranged. On error, mktime() returns -1.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
asctime(), asctime_r(), clock(), ctime(), ctime_r(), difftime(), gettimeofday(), gmtime(), gmtime_r(), localtime(), localtime_r(), strftime(), time(), tzset()


PTC MKS Toolkit 10.5 Documentation Build 40.