getting date of server

hi there. i need to find a way where i can get the “system date” of the navision server. because every client hanging on that server has different dates on their local machine, i need to have one reference date, the date of the server machine. how can i get that one through nav.?

I don’t know a system command but you can do : SystemScheduler on Server : create a batch with Date /t > DATEINAME DATEINAME should be in a diractory where all user have readpermission In navision read this file

Hi why has the workstations different dates? That seems a little odd. I suggest that you sync date and time in the workstations with the server. You can do that in the domain logon script. Pelle


Originally posted by pelle
why has the workstations different dates? That seems a little odd.

Hm, the world is round. And we have about (my latest count) 24 different timezones. So, if you are going to you bed I start working (on different days!). Immagine, if I connect to a server in Europe, I will be one day ahead. Regards Walter

Yes, you would need the server to return a UTC datetime, probably auto-converted by the client to local time (as with the treatment of today’s Datetime type). But as it is there is no feature for the server to send back any stamp, even a local time, to the client. It would actually make a useful C/AL function and was discussed when the Datetime data type was added in 3.60.

On the server you could run a NAS which updates a table once 1 minute…Ok it’s late maybe a bad idea.

You Can use shell command to retrieve date and time of Server.


Originally posted by pelle
You can do that in the domain logon script. Pelle

How would this script look like in JScript (to set date and time)?

Well, We have few clients running on SQL, who gets the Server date & Time. We have written a SQL View on the Server and we have a table with the same name as view in Navision. Structure will be like this: Table: (Date_Time) Primary Key Code 10 Server_Date Date Server_Time Time Codeunit: (Date_Time) Two New Functions 1) GetServerDate() [Return type is date] SELECTLATESTVERSION; IF NOT DateTime2.GET THEN rstDate_Time.Server_Date := TODAY; EXIT(rstDate_Time.Server_Date); 2) GetServerTime() [return type is time] SELECTLATESTVERSION; IF NOT rstDate_Time.GET THEN DateTime2.Server_Time:= TIME; EXIT(rstDate_Time.Server_Date); You can simply call the codeunit finction to get the server date & time. Have fun. Naveen Jain