Time.h
time.h is the C standard header that declares facilities for representing, querying, and manipulating calendar and processor time.
Modern C, Third Edition
time.h is the C standard header that declares calendar-time types and functions, including struct tm and related interfaces.
- How it is used
- Handles human-readable calendar time, timestamp differences, conversion, formatting, and physical-time queries.
- How deep it goes
- Explains struct tm fields, normalization through mktime, and formatting directives with concrete declarations and examples.
- Examples
- Uses designated struct tm initialization, member access, year calculation, and strftime format-specifier tables.
- What you can do after
- Apply it via standard interfaces to obtain timestamps, represent calendar dates, normalize fields, compare times, and format output.
Modern C
time.h is the C standard header that declares facilities for representing, querying, and manipulating calendar and processor time.
- How it is used
- Organizes calendar timestamps, human-readable date fields, formatting, and physical time measured in seconds and nanoseconds.
- How deep it goes
- Defines core representations and conversion steps, while deferring detailed locale behavior and implementation-specific formatting results.
- Examples
- Uses paired time calls, difftime, struct tm fields, mktime normalization, and strftime format specifiers.
- What you can do after
- Apply via time, difftime, mktime, strftime, and timespec_get to represent, compare, normalize, and format time values.
Related concepts
- system timeuses · A machine-provided or maintained representation of current time, commonly expressed as a calendar date and clock time.
- struct tmproduces · struct tm is a C standard library structure type representing broken-down calendar-time components such as seconds, minutes, days, months, and years.
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.

