Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Server Date
Message
From
20/10/2002 09:24:01
 
 
To
20/10/2002 01:34:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00713261
Message ID:
00713298
Views:
24
>How can I get the server system date from my workstation?
>
>I made a small function in the stored procedure of my database, the function is as follows.
>
>FUNCTION GetServDate
> MESSAGEBOX(DATE())
> RETURN DATE()
>EndFunc
>
>But when I execute this function from a workstation I am getting that workstations system date and not the server date. Can someone help me on this?

The easiest way to do this is to create a small file on the server, read the file's date/time stamp, and erase the file - the date/time for a disk volume come from the host (server) not the client. There is also an API call RemoteTOD() that will retrieve the date/time from a remote system, but it works only under NT/2K/XP.

The easy way:
cMyFileName = '\\MyServer\MyShare\'+SYS(2015)
nFH=FCREATE(cMyFileName)
=FCLOSE(nFH)
=ADIR(aFileName,cMyFileName)
ERASE (cMyFileName)
*  The date is in aFileName[1,3] and text time in aFileName[1,4]
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