Namespaces
Variants
Views
Actions

std::mktime

From cppreference.com
< cpp‎ | chrono‎ | c
Revision as of 06:57, 28 December 2011 by Cubbi (Talk | contribs)

Template:cpp/chrono/c/sidebar

Defined in header <ctime>
std::time_t mktime( std::tm* time );

Converts local calendar time to a time since epoch as a Template:cpp 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 Template:cpp object specifying local calendar time to convert

Return value

time since epoch as a Template:cpp object on success or Template:cpp if time cannot be represented as a Template:cpp object.

Example

Template:example cpp

See also

Template:cpp/chrono/c/dcl list localtime