Link to home
Start Free TrialLog in
Avatar of cycledude
cycledudeFlag for United Kingdom of Great Britain and Northern Ireland

asked on

C# 2010 Winforms get LAN server datetime

Hi

I have a requirement to get the datetime from the local network server, and not rely on users having correct datetime on their system..

How can I get the 'actual' datetime from the local server?

Cheers

CD
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg 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
Avatar of cycledude

ASKER

Hi

Thanks, I will try it, but it looks like it's getting the time from the internet... a problem I have (which I probably should have mentioned) is that not all users on the network have internet access rights on their windows login..
ntp1.ja.net  is indeed a internet server, but you presumably can use a "internal" server for that.
LAN restrictions are blocking access...
one thing that may be possible...

I have an access database that the application connects to... this is stored on a local server.

Is it possible to retrieve the server date/time via access?
not that I know of ...

but again: the time server doesn't need to be a "internet" server.
your domain should have a time server, just use that one instead.
I don't think it should be "blocked"
well, I tried replacing the '("ntp1.ja.net") with ("localservername");

and it did the same thing... just hung the application....
you will have to check with the relevant network admins about this issue...
I have accepted this as an answer, although it did not work for me...