Link to home
Start Free TrialLog in
Avatar of ammounpierre
ammounpierre

asked on

How to get the server's date always ?

Hello Guys,
I have my users who sometimes play around with dates on their PC and post transactions in my system -ERP that is under VFP9

Is there a way I could from a workstation get the server's date/time ?
so I can timestamp the transactions Vs the workstation date/time ?

I can not and do not want to prevent the users from changing the date on their pc.
I am okay with that and it is to happen.
all I need is a way , a command to be able to get the server's date/time regardless of my workstation's date/time.
thanks  a lot.
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

NET TIME \\SERVERNAME
However, if you allow workstations to change their time you could be in for problems.  Active Directory uses Kerberos for authentication - Kerberos requires the time to be "close" (usually within minutes) to that of the server.  If it isn't you could have problems.  If you need the system's time to be different, then you probably should look into using Virtual Machines and configuring the Virtual Machine to NOT be on the domain AND not sync its time with the host PC.  
You can create an ASP page on the server to return the datetime of the server.
Avatar of ammounpierre
ammounpierre

ASKER

How do I 'export' the net time to a text file ?
ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You may use API call to obtain server date & time:

http://support.microsoft.com/kb/249716

Another way is to create a file on the server and obtain the date/time by FDATE() and FTIME().