Skip to content
⌘ NSIS Forum Archive

Calling GetSystemTime API?

5 posts

billym#

Calling GetSystemTime API?

can someone assist me in the proper way to call the GetSystemTime API within NSIS.
Ex.
!define PATCHEXE "TimeApp.exe"
OutFile ${PATCHEXE}
Name "Time Demo"

Section GetSystemDateTime

System::Call 'kernel32::GetSystemTime(******************
MessageBox MB_OK ******************

SectionEnd
kichik#
Not tested, but it should work:

System::Alloc 128
Pop $0
System::Call "Kernel32::GetSystemTime(i) v (r0)"
System::Call "*$0(&i2 .r1, &i2 .r2, &i2 .r3, &i2 .r4, \
&i2 .r5, &i2 .r6, &i2 .r7, &i2 .r8)"
System::Free $0
DetailPrint "Year: $1"
DetailPrint "Month: $2"
DetailPrint "Day of the week: $3"
DetailPrint "Day: $4"
DetailPrint "Hour: $5"
DetailPrint "Minutes: $6"
DetailPrint "Seconds: $7"
DetailPrint "Milliseconds: $8"
This is a tweaked version of: