Namespaces
Variants
Views
Actions

mktime

From cppreference.com
< c‎ | chrono
Revision as of 21:35, 31 May 2013 by P12bot (Talk | contribs)

Defined in header <time.h>
time_t mktime( tm* time );

Converts local calendar time to a time since epoch as a time_t object. time->tm_wday and time->tm_yday are ignored. The values in time are not checked for being out of range.

A negative value of time->tm_isdst causes mktime to attempt to determine if Daylight Saving Time was in effect.

If the conversion is successful, the time object is modified. All fields of time are updated to fit their proper ranges. time->tm_wday and time->tm_yday are recalculated using information available in other fields.

Contents

Parameters

time - pointer to a tm object specifying local calendar time to convert

Return value

time since epoch as a time_t object on success or -1 if time cannot be represented as a time_t object.

Example

See also

converts time since epoch to calendar time expressed as local time
(function) [edit]