Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sync system time
Message
De
31/10/2013 14:45:49
 
 
À
30/10/2013 15:58:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01586885
Message ID:
01587022
Vues:
58
For those interested, I found this to be my simplest solution. I was unable to get the Joetools to work or the complicated gettime and settime procedures.

I need to get the time from my server independent of my client. Since I can no longer "ask the server" what time it is without a major security headache; I came up with this; (I:\ is of course a network drive on my server)
If File('i:\data\ecnc\data\setservertime.txt')
	Delete File 'i:\data\ecnc\data\setservertime.txt'
ENDIF
cFileDesc='File is created and deleted on the server so that the time can be retrieved from the remote server independant of the client ' + TTOC(DATETIME())

Strtofile(cFileDesc,'i:\data\ecnc\data\setservertime.txt')

? Datetime() &&returns the client datetime
? Fdate('I:\DATA\ecnc\Data\setservertime.txt',1) &&returns the server datetime
there is only second or two difference between the two when the clocks are synched.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform