4

I need to know if there is any .NET API exists to fetch the current time from Internet Time Server, so that changing the system time at the client will not affect the integrity of my application.

Saqwes
  • 325
  • 3
  • 12

4 Answers4

2

There's a third party library that should bail you out. See the NtpClient class

For other alternatives, see the similar thread here

Community
  • 1
  • 1
jglouie
  • 12,523
  • 6
  • 48
  • 65
1

You can use third party NTPClient.cs.

Example how to use:

DateTime time_nist_gov = NTPClient.GetTime().TransmitTimestamp; // uses NTPClient.DefaultTimeServer = "time.nist.gov"
DateTime time_windows_com = NTPClient.GetTime("time.windows.com").TransmitTimestamp;
DateTime pool_ntp_org = NTPClient.GetTime("pool.ntp.org").TransmitTimestamp;
stomy
  • 1,778
  • 1
  • 15
  • 16
1

Ah - no. Simple like that. No NTP support.

TomTom
  • 61,059
  • 10
  • 88
  • 148