Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
..changing system time programmatically or by and Active
Message
 
 
To
18/10/2001 06:52:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00570089
Message ID:
00570240
Views:
23
>>Is there a way for change the system time using an Active X control ?
>>Or maybe a way using code that probe to be is usefull ?
>>
>>
>> Thanks for your answers ...
>
>I don't know ActiveX for it but you could do with API :
>
>
DECLARE INTEGER SetSystemTime IN win32api STRING @ lpTime
>DECLARE INTEGER GetSystemTime IN win32api STRING @ lpTime
>
>lpCurrent = space(40)
>GetSystemTime(@lpCurrent) && save current
>
>* Set to 29th Feb, 2000 16:45:10.0100
>wYear = 2000
>wMonth = 2
>wDayOfWeek = 0 && ignored
>wDay = 29
>wHour = 16
>wMinute = 45
>wSecond = 10
>wMilliseconds = 100
>
>cNewTime = Num2Word(wYear)+;
>Num2Word(wMonth)+;
>Num2Word(wDayOfWeek)+;
>Num2Word(wDay)+;
>Num2Word(wHour)+;
>Num2Word(wMinute)+;
>Num2Word(wSecond)+;
>Num2Word(wMilliseconds)
>
>SetSystemTime(@cNewTime)
>
>? 'After setsystem time :',datetime()
>SetSystemTime(@lpCurrent)
>? 'Reset back to current :',datetime()
>
>Function Num2Word
>lparameters tnDecimal
>return chr(tnDecimal%256)+chr(int(tnDecimal/256))
Cetin

Cetin,
I wouldn't use the Systemtime functions. I would recommend the Localtime variations. Otherwise, when you set the time, you have to know the GMT offset and apply it so your clock isn't off by that much.

The syntax is the same so there is no big deal in using the others, IMO.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform