Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change the system date from vfp
Message
 
To
12/12/2004 15:06:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00968628
Message ID:
00968630
Views:
8
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform