Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
..changing system time programmatically or by and Active
Message
 
 
À
18/10/2001 06:52:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00570089
Message ID:
00570240
Vues:
22
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform