benilla-re systems structs docs

_mktime

function · crt · orchestration

Address
0x74066b · 14 bytes, up to 0x740678
Signature
int32_t __cdecl (tm *fields)
Meaning
Calls __make_time_t with the local flag 1
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 3

Callees 1

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