Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I 've to get the System Date from another PC
Message
From
31/08/1998 07:25:25
 
 
To
31/08/1998 04:44:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00131444
Message ID:
00131453
Views:
20
>I'm developing a multiuser application (not a Client/server anyway) and I've the need to get the datetime() of a master PC to synchronize (I think I made a mistake but I don't want to get the dictionary) all the other PC with that one.
>How can I do to do it ?

Unfortunately, it depends on the type of machine being used as the master PC, and the network environment. On Novell networks, if all your systems use the same server, and use login scripts, they will be synced to the clock on the Novell server every time they reboot, and there is a Novell API call to read the clock of the default server. In a Microsoft networking environment, you can synchronize to that station's clock using the DOS command line:

NET TIME \\computername /SET /YES

If the machine is in another workgroup or domain, you will need additional parameters. See the built-in help for the NET TIME command by entering:

NET TIME /? | MORE

at a DOS command prompt.

There is a Windows API call, NetRemoteTOD(), available to Windows NT 3.51 or later, and to Win98, but not to Win95 or Win3.x, that will request the time from a remote system acting as a time server. Short of that, you could create an out-of-process COM server that reported the time via a method call; you would run it on one of your machines which would become the server, and other machines would then attach to it via CREATEOBJ() and invoke the method when they wanted to read the server clock.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform