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
- Uses calendar-time representation to demonstrate C structures and their role in time-library interfaces.
- How deep it goes
- Explains member ranges, designated initialization, consistency, and mktime normalization, with a worked day-of-year calculation.
- Examples
- Works through an April 2019 initializer and a leap-year-aware day-of-year function.
- What you can do after
- Apply it via C’s time library to initialize calendar components, access members, and normalize a date with mktime.
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
- mktimeused by · mktime is a C standard-library function that converts a local broken-down calendar time to time_t while normalizing its fields.
- time.hproduced by · time.h is the C standard header that declares facilities for representing, querying, and manipulating calendar and processor time.
- structkind of · A struct is a named composite type or data structure that groups multiple fields or values into one structured unit.
Questions about struct tm
What is 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.
Which Manning books explain struct tm?
Modern C and Modern C, Third Edition.
What is struct tm a kind of?
Struct tm is a kind of struct. A struct is a named composite type or data structure that groups multiple fields or values into one structured 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.

