Mktime
mktime is a C standard-library function that converts a local broken-down calendar time to time_t while normalizing its fields.
Modern C, Third Edition
mktime is a C standard-library function that normalizes a local broken-down time and converts it to time_t.
- How it is used
- Normalizes local broken-down dates and converts them into arithmetic time_t values.
- How deep it goes
- Explains normalization, derived fields, DST resolution, and time_t conversion, but does not detail implementation internals.
- Examples
- Uses the mktime declaration and the struct tm fields tm_wday, tm_yday, and tm_isdst as concrete artifacts.
- What you can do after
- Apply mktime to normalize a local struct tm and obtain its corresponding time_t representation.
Modern C
mktime is a C standard library function that converts a broken-down local calendar time to a time_t value while normalizing its fields.
- How it is used
- Converts and normalizes local broken-down calendar times for subsequent time computations.
- How deep it goes
- Explains field conventions and three normalization steps, but defers implementation details.
- Examples
- Uses January numbering, Gregorian-year adjustment, weekday and yearday updates, and DST inference as concrete field examples.
- What you can do after
- Apply it via the C library to normalize a local struct tm and obtain a time_t value.
Related concepts
- time_tproduces · time_t is an implementation-defined C arithmetic type used to represent calendar time or elapsed-time values.
- struct tmuses · struct tm is a C standard library structure type representing broken-down calendar-time components such as seconds, minutes, days, months, and years.
- localtime_sequivalent to · localtime_s is an Annex K C library function that converts a time_t value to a broken-down local time in a caller-provided object.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

