Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking Server Time
Message
From
30/08/2005 11:20:47
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
30/08/2005 11:12:56
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01045173
Message ID:
01045176
Views:
20
There is probably some API, but I just created a temporary file on a shared folder on the server, and asked for the time of its creation with the appropriate file functions. The file should get the date/time of the server, not of the local machine.

By the way, I was not concerned (not yet) about users intentionally changing the date/time, but I wanted more or less accurate information (+- 10 minutes) for the audit trail, so if the user's machine is off by more than 10 minutes, they can't login. In your case, you will want to query immediately before doing the time-critical action.

>I need to check the time on the XP server prior to allowing a user action (basically it's an employee clock-in and I need to ensure they don't change the system time beforehand).
>
>I used to use the following command prompt from within vfp...
>net time \\servername /set /Y
>
>This changed the time on the local machine to be the same as the server's time. However it doesn't seem to work anymore under an XP server. (?)
>
>
>Ideally I would like just to query the server's datetime and to use _that_ datetime instead of the local one (not necessarily to change the local date/time).
>
>Is there a class of some sort available that will do this under VFP6?
>
>I realise I could use online atomic clock software, but not all pcs on this network have internet access.
>
>
>Hopefully someone here will be able to help.
>
>Thanks in advance,
>
> -Kevin.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform