News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Install date

Started by ecube, August 09, 2009, 01:08:49 PM

Previous topic - Next topic

ecube

HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\InstallDate

It's given as the number of seconds since January 1, 1970

how do I go about converting this into something readable?

dedndave

1970 ? - lol
file dates are based on the number of DAYS since Jan 1, 1980
maybe you can use that to do most of the work
i saw a thread a while back about julian date conversion
plug that into the search window and see what pops up

ecube

Quote from: dedndave on August 09, 2009, 01:39:07 PM
1970 ? - lol
file dates are based on the number of DAYS since Jan 1, 1980
maybe you can use that to do most of the work
i saw a thread a while back about julian date conversion
plug that into the search window and see what pops up
I just copy pasted what someone else said, its clear hes an idiot, ill search for the julian, thanls

drizz

It is called time_t. You are fast on calling other people idiotsĀ  :tdown

Time1970ToSystemTime proc __time_t:dword, __systemtime:dword

LOCAL ft:FILETIME

mov ecx,10000000
mov eax,__time_t
mul ecx
add eax,0D53E8000h;SecsTo1970.lo
adc edx,019DB1DEh;SecsTo1970.hi
mov ft.dwLowDateTime,eax
mov ft.dwHighDateTime,edx
invoke FileTimeToSystemTime,addr ft,__systemtime
ret

Time1970ToSystemTime endp

SystemTimeToTime1970 proc __systemtime:DWORD;ptr SYSTEMTIME

LOCAL ft:FILETIME

invoke SystemTimeToFileTime,__systemtime,addr ft
mov eax,ft.dwLowDateTime
mov edx,ft.dwHighDateTime
sub eax,0D53E8000h
sbb edx,019DB1DEh
mov ecx,10000000
div ecx
ret

SystemTimeToTime1970 endp
The truth cannot be learned ... it can only be recognized.

ecube

Quote from: drizz on August 09, 2009, 02:11:40 PM
It is called time_t. You are fast on calling other people idiotsĀ  :tdown

Time1970ToSystemTime proc __time_t:dword, __systemtime:dword

LOCAL ft:FILETIME

mov ecx,10000000
mov eax,__time_t
mul ecx
add eax,0D53E8000h;SecsTo1970.lo
adc edx,019DB1DEh;SecsTo1970.hi
mov ft.dwLowDateTime,eax
mov ft.dwHighDateTime,edx
invoke FileTimeToSystemTime,addr ft,__systemtime
ret

Time1970ToSystemTime endp

SystemTimeToTime1970 proc __systemtime:DWORD;ptr SYSTEMTIME

LOCAL ft:FILETIME

invoke SystemTimeToFileTime,__systemtime,addr ft
mov eax,ft.dwLowDateTime
mov edx,ft.dwHighDateTime
sub eax,0D53E8000h
sbb edx,019DB1DEh
mov ecx,10000000
div ecx
ret

SystemTimeToTime1970 endp


nice thumbs down, im ignoring your code  :tdown

ecube

On second thought, I don't need this information, I was gonna use it as a unique ID for customers serial generation, along with other hardware ids, but i'll just stick with what I have. Thanks for your time anyway dedndave.