How to get the server's date always ?

ammounpierre
ammounpierre used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
NET TIME \\SERVERNAME
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
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.  
CaptainCyrilFounder, Software Engineer, Data Scientist

Commented:
You can create an ASP page on the server to return the datetime of the server.
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Author

Commented:
How do I 'export' the net time to a text file ?
Technology and Business Process Advisor
Most Valuable Expert 2013
Commented:
You redirect it -

NET TIME \\SERVER > YourTextFile.txt 2>&1
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().

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial