tm
struct · crt · 36 bytes
- Meaning
- Holds broken-down time: seconds to years since 1900, the weekday, the day of the year and the daylight flag
- Confidence
- verified, proof one
- Finding
- crt/time#breaking-a-time-down-in-utc
Finding: Breaking a time down in UTC in crt: calendar time
gmtime(&t) answers null for a negative time. Otherwise it fills the calling thread's 36-byte
buffer, allocated on first use: the year from blocks of 1461 days from 1970, whose third year is
the one of 366 days; tm_yday from 0; the month as the last whose entry in the days-before-month
table, _lpdays in that year and _days in the others, is below tm_yday; tm_mday as
tm_yday less that entry; tm_wday from day 0, a Thursday; then the hours, minutes and seconds;
tm_isdst 0. The tables hold the days before each month less one, so January's entry is -1.
The derivation is in the doc.
Fields 9
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x0000 | 4 | int32_t | tm_sec | Holds the seconds of the minute | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x0004 | 4 | int32_t | tm_min | Holds the minutes of the hour | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x0008 | 4 | int32_t | tm_hour | Holds the hour of the day | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x000c | 4 | int32_t | tm_mday | Holds the day of the month from 1 | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x0010 | 4 | int32_t | tm_mon | Holds the month from 0 | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x0014 | 4 | int32_t | tm_year | Holds the years since 1900 | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x0018 | 4 | int32_t | tm_wday | Holds the weekday, Sunday 0 | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x001c | 4 | int32_t | tm_yday | Holds the day of the year from 0 | verified, proof one | crt/time#breaking-a-time-down-in-utc |
0x0020 | 4 | int32_t | tm_isdst | Holds the daylight flag: positive in daylight time, 0 not, negative unknown to mktime | verified, proof one | crt/time#breaking-a-time-down-in-utc |