benilla-re systems structs docs

_localtime

function · crt · primitive

Address
0x73f125 · 352 bytes, up to 0x73f284
Signature
tm * __cdecl (const int32_t *t)
Meaning
Breaks a time down in the zone, as gmtime of the time less _timezone; null for a negative time
Confidence
verified, proof one
Name from
the community database (idb)
Finding
crt/time#local-time
Test
crt::crt_localtime_difftest

Finding: Local time in crt: calendar time

localtime(&t) answers null for a negative time and reads the zone first. For a time more than three days into 1970 and three days short of 2^31, it answers gmtime of t − _timezone, and when _daylight is set and __isindst holds for that, gmtime of it less _dstbias with tm_isdst 1. Nearer either end it takes gmtime(t) and carries −_timezone, and −_dstbias when __isindst holds, through the fields by hand, tm_isdst left 0: a day back across January 1 gives December 31 of the year before with tm_yday 364, and a day forward is added to tm_mday and tm_yday with no month carried. __isindst's rules are not read here; it answers 0 while _daylight is 0.

The derivation is in the doc.

Callers 7

Callees 3

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