Old 22nd November 2012, 02:15   #1
habenyamin
Junior Member
 
Join Date: Nov 2012
Posts: 7
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
habenyamin is offline   Reply With Quote
Old 22nd November 2012, 06:24   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You can find all win32 time-related functions here:
http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
MSG is offline   Reply With Quote
Old 22nd November 2012, 10:46   #3
habenyamin
Junior Member
 
Join Date: Nov 2012
Posts: 7
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
habenyamin is offline   Reply With Quote
Old 30th July 2014, 06:25   #4
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
How to set (change) only date ? Time does not change !
stass is offline   Reply With Quote
Old 30th July 2014, 19:44   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
Quote:
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?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 31st July 2014, 06:52   #6
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
Quote:
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
stass is offline   Reply With Quote
Old 31st July 2014, 10:24   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
You have to get the current time first:

Quote:
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 31st July 2014, 11:07   #8
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
Anders, Does not work ...
stass is offline   Reply With Quote
Old 31st July 2014, 12:57   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
Quote:
Originally Posted by stass View Post
Anders, Does not work ...
I changed the code, you can try again (I have not tested it myself...)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 31st July 2014, 13:23   #10
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
Anders
ОK. Thank you !
stass is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump