mktime

From cppreference.com
< c | chrono
Defined in header <time.h>

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

[edit] Parameters

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

[edit] Return value

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

[edit] Example

[edit] See also

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