Avatar of cycledude
cycledude
Flag 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
C#

Avatar of undefined
Last Comment
cycledude

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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..
Guy Hengel [angelIII / a3]

ntp1.ja.net  is indeed a internet server, but you presumably can use a "internal" server for that.
cycledude

ASKER
LAN restrictions are blocking access...
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
cycledude

ASKER
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?
Guy Hengel [angelIII / a3]

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"
cycledude

ASKER
well, I tried replacing the '("ntp1.ja.net") with ("localservername");

and it did the same thing... just hung the application....
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Guy Hengel [angelIII / a3]

you will have to check with the relevant network admins about this issue...
cycledude

ASKER
I have accepted this as an answer, although it did not work for me...