tm structv0.1.0
C's tm: a calendar time broken into its components.
pub struct tm {
pub tm_sec: int32;
pub tm_min: int32;
pub tm_hour: int32;
pub tm_mday: int32;
pub tm_mon: int32;
pub tm_year: int32;
pub tm_wday: int32;
pub tm_yday: int32;
pub tm_isdst: int32;
pub tm_gmtoff: int64;
pub tm_zone: *char8;
}
Two of the fields are traps rather than conveniences, and both are C's rather than this binding's: tm_year
counts from 1900, so 2026 is 126, and tm_mon counts from zero, so December is 11. tm_sec reaches 60 for
a
leap second.
Declared once per system because the field order and the trailing members differ; the nine standard fields
are
the same everywhere and are all this declares.
See also: https://en.cppreference.com/c/chrono/tm
Fields
| Name | Type | Description |
|---|---|---|
tm_sec | int32 | Seconds after the minute 0, 60. |
tm_min | int32 | Minutes after the hour 0, 59. |
tm_hour | int32 | Hours since midnight 0, 23. |
tm_mday | int32 | Day of the month 1, 31. |
tm_mon | int32 | Months since January 0, 11. |
tm_year | int32 | Years since 1900. |
tm_wday | int32 | Days since Sunday 0, 6. |
tm_yday | int32 | Days since January 1 0, 365. |
tm_isdst | int32 | Daylight saving time flag. |
tm_gmtoff | int64 | Seconds east of UTC. A BSD and glibc extension, not in standard C. (Linux · macOS · FreeBSD only) |
tm_zone | *char8 | The time zone's abbreviation, in storage the C runtime owns. (Linux · macOS · FreeBSD only) |