Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set the system date to different date
Message
From
22/05/2002 09:46:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/05/2002 09:24:56
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00659869
Message ID:
00659883
Views:
31
This message has been marked as the solution to the initial question of the thread.
>Hello
>
>How to set the system date to different date in batch file and again reset to original date.
>
>txs
DECLARE INTEGER SetLocalTime IN win32api STRING @ lpTime
DECLARE INTEGER GetLocalTime IN win32api STRING @ lpTime
public lpCurrent
lpCurrent = space(40)
GetLocalTime(@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)

SetLocalTime(@cNewTime)
? datetime()
SetLocalTime(@cNewTime)
? datetime()
SetLocalTime(@lpCurrent)
? datetime()
SetLocalTime(@lpCurrent)
? datetime()

Function Num2Word
lparameters tnDecimal
return chr(tnDecimal%256)+chr(int(tnDecimal/256))
Warning : Double call is intentional because of daylight settings.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform