Struct tm
struct tm is a C standard library structure type representing broken-down calendar-time components such as seconds, minutes, days, months, and years.
Modern C
struct tm is the C standard library structure type for decomposed calendar-time components such as seconds, days, months, and years.
- How it is used
- Represents calendar dates as named components for initialization, member access, and time-library conversion.
- How deep it goes
- Works through designated initialization, member counting rules, omitted-member defaults, consistency, and mktime normalization.
- Examples
- Uses a 3 April 2019 initializer and a leap-year-aware function that computes tm_yday.
- What you can do after
- Operate/configure it with designated initializers and mktime to construct and normalize calendar-time values.
Modern C, Third Edition
struct tm is the C standard-library structure type for representing broken-down calendar time components such as seconds, days, months, and years.
- How it is used
- Represents human-oriented calendar times and supplies structured fields for date arithmetic, conversion, and formatting.
- How deep it goes
- Defines members, encodings, initialization, consistency, and mktime normalization, but does not develop complete time-zone or formatting behavior.
- Examples
- Uses a 2019 date initializer, member-based year printing, and a day-of-year calculation that accounts for leap years.
- What you can do after
- Apply it via <time.h> to construct, inspect, normalize, convert, and format calendar-time values.
Related concepts
- time.hproduced by · time.h is the C standard header that declares facilities for representing, querying, and manipulating calendar and processor time.
- mktimeused by · mktime is a C standard-library function that converts a local broken-down calendar time to time_t while normalizing its fields.
- structkind of · A struct is a composite data type or structure that groups related fields or values into a single unit.
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.

