SetSystemDate

Just starting out? Need help? Post your questions and find answers here.
TeddyLM
Enthusiast
Enthusiast
Posts: 133
Joined: Wed Apr 30, 2003 2:04 pm
Location: Germany (French expat)

SetSystemDate

Post by TeddyLM »

How can i set a new system date from a pb app ?
Does anybody know a way ?

need your help !
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: SetSystemDate

Post by PB »

For Windows only:

Code: Select all

; Sets date to Christmas day in 2003 at 6:30pm.
NewTime.SYSTEMTIME
NewTime\wDay=25
NewTime\wMonth=12
NewTime\wYear=2003
NewTime\wHour=18
NewTime\wMinute=30
NewTime\wSecond=00
SetLocalTime_(NewTime)
Note: For Windows NT, 2K and XP you may need to adjust system
privileges to adjust the time, but I'm not 100% sure how to do that.
TeddyLM
Enthusiast
Enthusiast
Posts: 133
Joined: Wed Apr 30, 2003 2:04 pm
Location: Germany (French expat)

SetSystemDate Works fine !

Post by TeddyLM »

Works fine on W2k...
I'm working now... will test this evening on XP.

Thanks PB
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Under Nt-2K-XP the user running the app must have te privilege to change the time.
No problem for a local administrator of course
Post Reply