Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change systems date and time
Message
 
To
15/10/1996 20:20:21
Claudio Abad
Compañía Financiera Argentina
Buenos Aires, Argentina
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00010147
Message ID:
00010166
Views:
41
Here's something that I fried my brain on (I hate bit math). This even shows the example of passing a structure to a Win API. Also note: This is on NT/Win95. You might be able to use the same function in the 16 bit world, but call it in Kernel instead of Kernel32. ******* Begin Code *********** DECLARE SetLocalTime IN "kernel32.dll" STRING @Time *------------------------------------------ * cMyTime Structure is as follows * * DWORD = 2 bytes * * DWORD Year * DWORD Month * DWORD Day Of Week (0 = Sunday) * DWORD Day Of Month * DWORD Hour * DWORD Minute * DWORD Second * DWORD Millisecond *------------------------------------------ cMyTime = ITOC(YEAR(DATE()))+ITOC(MONTH(DATE()))+ITOC(DOW(DATE())-1) cMyTime = cMyTime+ITOC(DAY(DATE()))+ITOC(HOUR(DATETIME())) cMyTime = cMyTime+ITOC(MINUTE(DATETIME()))+CHR(0)+CHR(0)+CHR(0)+CHR(0) = SetLocalTime(@cMyTime) FUNCTION ITOC LPARAMETERS nNumber cReturnString = CHR(MOD(nNumber, 256)) + CHR(INT(nNumber/ 256)) RETURN cReturnString ******* End Code *********** -= Ken =-
kenti@oz.net
kenti@msn.com
kenti001@aol.com
74441.1210@compuserve.com
Microsoft Certified Professional - Visual FoxPro
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform