Getting the Time/Date from the Navision Server.

How can I pull the system Time from the Navision Server? We have a client that has Navision clients in multiple time zones and needs to pull the time from the Navision support into a Time field on the the sales order form. The would like to store the Time of when the Sales order was created in local time. Any ideas out there? If there is a dll/ocx I need to use, does anyone know which one? Thanks in advance.

You can use the internal Navision Financials function Time. Here is what the help text says:

Use this function to retrieve the current time from the operating system.

**Time := TIME**

Time

Data type: time

The current time.

**Comments**

You can only use the TIME function to retrieve the time from the operating system. You cannot use it to set the time in the operating system.

**Example**

This example shows how to use the TIME function.

MESSAGE('The current system time is: %1', TIME);

The message window could show:

The current system time is: 4:15:46 PM

It’s not quite clear to me if you need the local time to the user or to the server. If it’s the local server time, then this funtion combined with a new field on the user to tell you how many hours ± you must add or substract can do the job. Best regards, Erik P. Ernst, webmaster Navision Online User Group

I know about the TIME function as that is what I am currently using. The local time I am refering to is the time on the navision financials server, and not the client machine. There is probably a dll/ocx out there which navision can use that will give me this server information. I just do not know what that file is.

Talk to Your network administrator. He/she should be able to syncronize the clients clock’s in the login script.

Even if you had such a file on your server, then you couldn’t use it. Or at least you can’t expect that you can use it. When you connect to Navision using TCPIP or Netbios, then this is actually the only connection you need to have to this server. So you can’t access another file on this server. (For local users on the same location as the server you can usually get this direct access). So I would still recommend you to use the TIME function and a TimeZone field on the User record, eventually combined with Lars’ time syncronizer. Best regards, Erik P. Ernst, webmaster Navision Online User Group

Hello everybody! I had the same/similar problem, i need to get the server-time for some protocolls/logs … On a NT Server it works with the Command net time \ /set /yes which i start with the Navision SHELL Function. Regards, Joerg Joerg A. Stryk Apollo-Optik, IT/ERP

I like the idea of using NET TIME but as this is run in the Command Prompt, how do you capture the returned value in a variable within Navision?

Well, NET TIME sets the global System-Date and Time, so after this function-call you can save your value with TimeVar := TIME; Bye, Joerg Joerg A. Stryk Apollo-Optik, IT/ERP

I do not want to change the time on the users computer but however, I will talk to the client and see if they like this idea. Thanks for all your help.