Skip to content
⌘ NSIS Forum Archive

how can change time zone & dataTime by nsis

10 posts

habenyamin#

how can change time zone & dataTime by nsis

how can get & set data-time And also time zone by calling Kernel32.dll?
set local time
get time zone
set time zone
MSG#
You can find all win32 time-related functions here:
habenyamin#
thanks i Could handle set time
ex.
System::Call '*(&i2 2012, &i2 12, &i2 5, &i2 22, &i2 2, &i2 54, &i2 20) i .r0'
System::Call 'kernel32::SetLocalTime(i r0) i.r0'

but for changing time zone can u help me
Anders#
Originally Posted by stass View Post
How to set (change) only date ? Time does not change !
Which code are you using? If it is the code from this thread, what is the return value of the SetLocalTime call ($0)?

Does the time not change or do you not want to change the time?
stass#
Originally Posted by Anders View Post
Does the time not change or do you not want to change the time?
Yes. Time should not be changed
Anders#
You have to get the current time first:

System::Call '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2)i.r0'
System::Call 'kernel32::GetLocalTime(i r0)i.r1'
System::Call '*$0(&i2 2010,&i2 11,&i2,&i2 12)'
System::Call 'kernel32::SetLocalTime(i r0)'
System::Call 'kernel32::SetLocalTime(i r0)'
System::Free $0
Anders#
Originally Posted by stass View Post
Anders, Does not work ...
I changed the code, you can try again (I have not tested it myself...)