Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server Date
Message
De
20/10/2002 09:24:01
 
 
À
20/10/2002 01:34:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00713261
Message ID:
00713298
Vues:
25
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform