Namespaces
Variants
Views
Actions

mktime

From cppreference.com
< c‎ | chrono
Revision as of 23:13, 2 November 2012 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, ignoring the values of time->tm_wday and time->yday. The values of other components of time are not restricted to their usual ranges. A negative value of time->tm_isdst causes mktime to attempt to determine if Daylight Saving Time was in effect.

If successful, recalculates and updates all fields in time to fit their proper ranges.

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

Template:c/chrono/dcl list localtime