tm structv0.1.0

Source
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

NameTypeDescription
tm_secint32Seconds after the minute 0, 60.
tm_minint32Minutes after the hour 0, 59.
tm_hourint32Hours since midnight 0, 23.
tm_mdayint32Day of the month 1, 31.
tm_monint32Months since January 0, 11.
tm_yearint32Years since 1900.
tm_wdayint32Days since Sunday 0, 6.
tm_ydayint32Days since January 1 0, 365.
tm_isdstint32Daylight saving time flag.
tm_gmtoffint64Seconds east of UTC. A BSD and glibc extension, not in standard C. (Linux · macOS · FreeBSD only)
tm_zone*char8The time zone's abbreviation, in storage the C runtime owns. (Linux · macOS · FreeBSD only)