Re: How to change system date
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Feb 26, 2007
- 549 views
Ricardo Forno wrote: > > Bernie Ryan wrote: > > > > Ricardo Forno wrote: > > > > > > Hi all. > > > Does anybody know if there is a way to change the system date using EU > > > code? > > > Thanks. > > > > Ricardo: > > > > You will need to use the SetSystemTime() and GetSystemTime() > > To change the date. > > The date is an entry in the SystemTime structure that is used > > as the parameter that is used by these functions. > > > > Bernie > > > > My files in archive: > > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > > > Can be downloaded here: > > <a > > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a> > > OK, Bernie, but where can I get these routines? > I could not find them in EU 3.0.2 nor Winlib. > Regards. In Win32lib, you have the fetch_SYSTEMTIME() and struct_SYSTEMTIME() routines to set or get a SYSTEMTIME structure. To set the system date/time, just wrap the SetSystemTime() API routine, and call it using a SYSTEMTIME structure address. Simple, eh? The hitch, though, is that your process must have the right privileges to do this. Plesae refer to the SetSystemTime API docs for more info on that. You'll have to tweak the privileges of your process' handle so as to enable the procedure to succeed. Can't test this right now. CChris