benilla-re systems structs docs

__make_time_t

function · crt · primitive

Address
0x740687 · 484 bytes, up to 0x74086a
Signature
int32_t __cdecl (tm *fields, int32_t local)
Meaning
Builds a 32-bit time from fields of 1969 to 2039, -1 on overflow, the zone added through localtime
Confidence
verified, proof one
Name from
the community database (idb)
Finding
crt/time#fields-to-a-time
Test
crt::crt_mktime_difftest

Finding: Fields to a time in crt: calendar time

mktime(tm) is __make_time_t(tm, 1): -1 for a tm_year outside 69 to 139, a tm_mon outside 0 to 11 folded into the year, stored back, and the year tested again. With days before the month, one more past February when 4 divides the year, it sums year · 365 + ((year − 1) >> 2) + days − 25567 + tm_mday, times 24 plus tm_hour, times 60 plus tm_min, times 60 plus tm_sec, -1 on any signed 32-bit overflow. It adds _timezone untested, -1 when localtime of that is null. A positive tm_isdst, or a negative one with that answer in daylight time, adds _dstbias for a second localtime. The last answer is copied over the fields and the sum answered.

The derivation is in the doc.

Callers 2

Callees 3

Calls and jumps by a bare address, from tables/calls.tsv.