Tm-structure

From aldeid
Jump to: navigation, search

Description

Member Type Meaning Range
tm_sec int seconds after the minute 0-60*
tm_min int minutes after the hour 0-59
tm_hour int hours since midnight 0-23
tm_mday int day of the month 1-31
tm_mon int months since January 0-11
tm_year int years since 1900
tm_wday int days since Sunday 0-6
tm_yday int days since January 1 0-365
tm_isdst int Daylight Saving Time flag

(*) tm_sec is generally 0-59. The extra range is to accommodate for leap seconds in certain systems.

Example

.text:004017FF loc_4017FF:
.text:004017FF                 push    0               ; Time
.text:00401801                 call    ds:_time64
.text:00401807                 add     esp, 4
.text:0040180A                 mov     dword ptr [ebp+Time], eax
.text:0040180D                 lea     eax, [ebp+Time]
.text:00401810                 mov     dword ptr [ebp+Time+4], edx
.text:00401813                 push    eax             ; Time
.text:00401814                 call    ds:_localtime64
.text:0040181A                 mov     esi, ds:[email protected]@Z ; operator delete(void *)
.text:00401820                 add     esp, 4
.text:00401823                 mov     edx, [eax+tm.tm_year]   ; edx = years since 1900
.text:00401826                 mov     ecx, [eax+tm.tm_mon]    ; ecx = month (0-11)
.text:00401829                 add     edx, 76Ch               ; edx = year + 1900 = current year
.text:0040182F                 mov     eax, [eax+tm.tm_mday]   ; eax = mday