Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get a server date & time
Message
 
 
À
13/10/2000 13:38:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00429244
Message ID:
00429252
Vues:
28
>I need to get the server date&time in order to set this date on my computer. I know that there is a way using the NET TIME command, but I would like to use an API fuction. Any Idea?

If you are using NT then you can read my FAQ on time synchronizing server and client machines. If you are using Win9X on your client systems, there is another approach.

Create a file using the low level file functions (LLFF) on the server. Use ADIR() to get the datetime of that file. The datetime will be determined by the server not the client that created it. Then use the SetLocalTime function of the WinAPI to set the time. The SetSystemTime function is documented in the API section here and the only change you need to make for SetLocalTime is the name of function. All parameters and structures are the same.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform