Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query time from server?
Message
De
24/08/2009 20:22:08
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01420325
Message ID:
01420344
Vues:
53
Setting system date and time would be nice -- as long as you know the time/date you want to synchronize to...

The problem I'm having is determining the time/date on the fileserver from a workstation. In NT platform there is an API call to allow me to do this son on NT-based systems it's not a problem. Win95/98/Me lacks this function -- so I'm left with technique such as creating a file on the fileserver and checking the timestamp of the created file. Unfortunately it appears that the timestamp generated isn't guaranteed to be based on the fileserver date/time (worked in Novell, but not in Win 2000, Win 2003 nor Linux fileservers -- all of which yielded timestamp based on workstation date/time, which could've been tampered with).

Of course, using the "NET TIME \\servername" works and returns the time/date of the workstation -- except that the format of the output depends on the locale settings on the server (e.g. it's not guaranteed to be MM/DD/YYYY -- it could just as easily be DD/MM/YYYY). The other problem is that because it's returning the time adjusted for Daylight Saving, but doesn't provide a suffix to allow us to avoid the ambiguity that occurs when going from Daylight Time to Standard Time (where time gets set back -- usually 1 hour). If the time display were to something to indicate Standard and Daylight time there wouldn't be a problem, but unfortunately no such indicator is used -- resulting in a 1-hour period where the time could be ambiguous (when going from daylight time to standard we set back the clock 1 hour -- so we've got a 1-hour period there are duplicated times -- one set from Daylight and the other Standard).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform