Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change the system date from vfp
Message
De
12/12/2004 15:22:28
 
 
À
12/12/2004 15:06:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00968628
Message ID:
00968630
Vues:
10
Try this:
FUNCTION SetTime()
   LOCAL dcDate, cTime, cBuff
   dDate = DATE()
   cTime = TIME()
   cBuff =         Num2WORD(YEAR(dDate))
   cBuff = cBuff + Num2WORD(MONTH(dDate))
   cBuff = cBuff + Num2WORD(1)                      && Day of the week ignore it
   cBuff = cBuff + Num2WORD(DAY(cDate))
   cBuff = cBuff + Num2WORD(VAL(LEFT(cTime,2)))     && Hour
   cBuff = cBuff + Num2WORD(VAL(SUBSTR(cTime,4,2))) && Munites
   cBuff = cBuff + Num2WORD(VAL(RIGHT(cTime,2)))    && Seconds
   cBuff = cBuff + Num2WORD(0)+CHR(0)
   DECLARE INTEGER  SetLocalTime IN WIN32API STRING @cBuff
   SetLocalTime(@cBuff)

RETURN


FUNCTION Num2WORD(tnNum)
	LOCAL x
	x=INT(tnNum)
RETURN CHR(MOD(x,256))+CHR(INT(x/256))
>how to change the system date from vfp
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform